diff --git a/Makefile b/Makefile index a74da6f..df51e5d 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ PACKAGE = GServer VERSION = 0.0.0 SUBDIRS = src RM = rm -f -LN = ln -sf +LN = ln -f TAR = tar -czvf @@ -19,7 +19,7 @@ distclean: dist: $(RM) -r $(PACKAGE)-$(VERSION) - $(LN) . $(PACKAGE)-$(VERSION) + $(LN) -s . $(PACKAGE)-$(VERSION) @$(TAR) $(PACKAGE)-$(VERSION).tar.gz \ $(PACKAGE)-$(VERSION)/src/gserver.c \ $(PACKAGE)-$(VERSION)/src/project.conf \ diff --git a/src/Makefile b/src/Makefile index 7671d3d..702e3c2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,14 +3,15 @@ TARGETS = GServer PREFIX = /usr/local DESTDIR = BINDIR = $(PREFIX)/bin -INCLUDEDIR= $(PREFIX)/include CC = cc +CPPFLAGSF= CPPFLAGS= CFLAGSF = -W -CFLAGS = -Wall -g -O2 -ansi -LDFLAGSF= -l System -l GL +CFLAGS = -Wall -g -O2 -pedantic +LDFLAGSF= -lSystem -lGL LDFLAGS = -L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib RM = rm -f +LN = ln -f MKDIR = mkdir -p INSTALL = install @@ -21,10 +22,11 @@ subdirs: @for i in $(SUBDIRS); do (cd $$i && $(MAKE)) || exit; done GServer_OBJS = gserver.o -GServer_CFLAGS = $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) +GServer_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) +GServer_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) GServer: $(GServer_OBJS) - $(CC) -o GServer $(GServer_OBJS) $(LDFLAGSF) $(LDFLAGS) + $(CC) -o GServer $(GServer_OBJS) $(GServer_LDFLAGS) gserver.o: gserver.c $(CC) $(GServer_CFLAGS) -c gserver.c @@ -40,11 +42,8 @@ distclean: install: all @for i in $(SUBDIRS); do (cd $$i && $(MAKE) install) || exit; done - $(MKDIR) $(DESTDIR)$(BINDIR) - $(INSTALL) -m 0755 GServer $(DESTDIR)$(BINDIR)/GServer uninstall: @for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done - $(RM) $(DESTDIR)$(BINDIR)/GServer .PHONY: all subdirs clean distclean install uninstall diff --git a/src/gserver.c b/src/gserver.c index 7db458d..26a3a80 100644 --- a/src/gserver.c +++ b/src/gserver.c @@ -1,10 +1,13 @@ -/* gserver.c */ +/* $Id$ */ +/* Copyright (c) 2009 Pierre Pronchery */ +/* This file is part of DeforaOS GServer */ -#include #include +#include #include +#include #include "video/video.h" @@ -21,6 +24,7 @@ typedef struct _GServer /* functions */ static int _gserver_init(GServer * gserver); static void _gserver_destroy(GServer * gserver); + static int _gserver(void) { GServer gserver; @@ -36,7 +40,7 @@ static int _gserver(void) return 2; } -int _init_video(GServer * gs); +static int _init_video(GServer * gs); static int _gserver_init(GServer * gs) { memset(gs, 0, sizeof(GServer)); @@ -64,7 +68,7 @@ static void _gserver_destroy(GServer * gs) /* video */ -int _init_video(GServer * gs) +static int _init_video(GServer * gs) /* FIXME ask Hardware what to load instead of hard-coding vesa */ { void * handle; diff --git a/src/project.conf b/src/project.conf index c43cf9a..7ccd8d8 100644 --- a/src/project.conf +++ b/src/project.conf @@ -1,8 +1,8 @@ subdirs=video targets=GServer cflags_force=-W -cflags=-Wall -g -O2 -ansi -ldflags_force=-l System -l dl -l GL +cflags=-Wall -g -O2 -pedantic +ldflags_force=-lSystem -lGL ldflags=-L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib [GServer] diff --git a/src/video/Makefile b/src/video/Makefile index e8bec2d..94a0401 100644 --- a/src/video/Makefile +++ b/src/video/Makefile @@ -3,13 +3,15 @@ PREFIX = /usr/local DESTDIR = LIBDIR = $(PREFIX)/lib CC = cc +CPPFLAGSF= CPPFLAGS= -CFLAGSF = -W -Wall -ansi -CFLAGS = -g +CFLAGSF = -W +CFLAGS = -Wall -g -O2 -fPIC -pedantic AR = ar -rc RANLIB = ranlib -LD = ld -shared +LD = $(CC) -shared RM = rm -f +LN = ln -f MKDIR = mkdir -p INSTALL = install @@ -17,14 +19,15 @@ INSTALL = install all: $(TARGETS) vesa_OBJS = vbe.o vesa.o -vesa_CFLAGS = $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) +vesa_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) +vesa_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) vesa.a: $(vesa_OBJS) $(AR) vesa.a $(vesa_OBJS) $(RANLIB) vesa.a vesa.so: $(vesa_OBJS) - $(LD) -o vesa.so $(vesa_OBJS) + $(LD) -o vesa.so -Wl,-soname,vesa.so.0 $(vesa_OBJS) vbe.o: vbe.c $(CC) $(vesa_CFLAGS) -c vbe.c @@ -39,12 +42,7 @@ distclean: clean $(RM) $(TARGETS) install: all - $(MKDIR) $(DESTDIR)$(LIBDIR) - $(INSTALL) -m 0644 vesa.a $(DESTDIR)$(LIBDIR)/vesa.a - $(INSTALL) -m 0755 vesa.so $(DESTDIR)$(LIBDIR)/vesa.so uninstall: - $(RM) $(DESTDIR)$(LIBDIR)/vesa.a - $(RM) $(DESTDIR)$(LIBDIR)/vesa.so .PHONY: all clean distclean install uninstall diff --git a/src/video/project.conf b/src/video/project.conf index 2804c30..8de3c92 100644 --- a/src/video/project.conf +++ b/src/video/project.conf @@ -1,6 +1,6 @@ targets=vesa -cflags_force=-W -Wall -ansi -cflags=-g +cflags_force=-W +cflags=-Wall -g -O2 -fPIC -pedantic dist=vbe.h,video.h [vesa]