2008-03-31 00:14:35 +02:00
|
|
|
CC = g++
|
|
|
|
AR = ar
|
2008-09-19 17:34:01 +02:00
|
|
|
OBJECTS = segl.o punkt3d.o punkt2d.o emath.o emath_opengl.o color.o gldrawhelper.o glfontengine.o rect.o gltexture.o matrix.o quaternion.o rotationsmatrix.o glsdlscreen.o sdlfuncs.o fpsmanager.o glcamera.o catmullromspline.o extstring.o quader.o geotypes.o
|
|
|
|
OBJOPT = -Wall -c -DVERSION=\"$(VERSION)\" -O2 `sdl-config --cflags`
|
|
|
|
WINOPT = -Wall -c -DVERSION=\"$(VERSION)\" -O2 -I/usr/i586-mingw32msvc/include -I/usr/i586-mingw32msvc/include/SDL
|
2008-08-10 17:14:54 +02:00
|
|
|
LIBLINK = -lc -shared -Wl,-soname,$(LIBNAME).so.$(LIBVERSION)
|
|
|
|
WINLINK = -L/usr/i586-mingw32msvc/lib /usr/i586-mingw32msvc/lib/SDL_image.lib -lmingw32 -shared -mwindows -lGL -lGLU -lSDL -lSDL_image /usr/i586-mingw32msvc/lib/SDL_image.lib /usr/i586-mingw32msvc/lib/SDL_image.dll
|
2008-06-17 02:46:39 +02:00
|
|
|
SUBDIRS = glgui glmenu model
|
|
|
|
SUBDIROBJECTS = glgui/*.o glmenu/*.o model/*.o
|
2008-08-10 17:14:54 +02:00
|
|
|
VERSION = 0.1.1
|
|
|
|
LIBVERSION = 1
|
2008-02-10 20:50:42 +01:00
|
|
|
LIBNAME = libsegl
|
2008-08-10 17:14:54 +02:00
|
|
|
EXT = so.$(LIBVERSION)
|
|
|
|
|
|
|
|
.PHONY: windows
|
2008-02-09 13:43:23 +01:00
|
|
|
|
2008-09-19 17:34:01 +02:00
|
|
|
all: seglar lib
|
|
|
|
|
2008-03-08 23:03:26 +01:00
|
|
|
seglar: $(OBJECTS) subdirs
|
2008-02-10 20:50:42 +01:00
|
|
|
rm -f $(LIBNAME).a
|
2008-03-31 00:14:35 +02:00
|
|
|
$(AR) rcs $(LIBNAME).a $(OBJECTS) $(SUBDIROBJECTS)
|
2008-02-10 20:50:42 +01:00
|
|
|
# ranlib $(LIBNAME).a
|
2008-03-08 23:03:26 +01:00
|
|
|
|
2008-08-10 17:14:54 +02:00
|
|
|
lib: LINKER = $(LINKER)
|
|
|
|
lib: $(OBJECTS) subdirs
|
|
|
|
$(CC) -o $(LIBNAME).$(EXT) $(OBJECTS) $(SUBDIROBJECTS) $(LIBLINK)
|
2008-03-08 23:03:26 +01:00
|
|
|
|
|
|
|
subdirs:
|
2008-03-31 18:48:58 +02:00
|
|
|
@for i in $(SUBDIRS); do $(MAKE) CC="$(CC)" AR="$(AR)" OBJOPT="$(OBJOPT)" -C $$i; done
|
2008-02-09 13:43:23 +01:00
|
|
|
|
|
|
|
%.o: %.cpp %.h
|
2008-03-31 00:14:35 +02:00
|
|
|
$(CC) $(OBJOPT) $<
|
2008-02-09 13:43:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
glgui/glgui.a:
|
|
|
|
cd glgui; $(MAKE);
|
|
|
|
|
2008-03-08 23:03:26 +01:00
|
|
|
glmenu/glmenu.a:
|
|
|
|
cd glmenu; $(MAKE);
|
|
|
|
|
2008-02-10 20:50:42 +01:00
|
|
|
testprog: seglar testprog.o
|
|
|
|
g++ `sdl-config --libs` -lSDL_image -lGL -lGLU testprog.o -o testprog $(LIBNAME).a
|
2008-03-31 00:14:35 +02:00
|
|
|
|
2008-08-10 17:14:54 +02:00
|
|
|
winlib: CC = i586-mingw32msvc-g++
|
|
|
|
winlib: AR = i586-mingw32msvc-ar
|
|
|
|
winlib: OBJOPT = $(WINOPT)
|
|
|
|
winlib: LIBLINK = $(WINLINK)
|
|
|
|
winlib: export EXT = dll
|
|
|
|
winlib: lib
|
|
|
|
|
|
|
|
winar: CC = i586-mingw32msvc-g++
|
|
|
|
winar: AR = i586-mingw32msvc-ar
|
|
|
|
winar: OBJOPT = $(WINOPT)
|
|
|
|
winar: LIBLINK = $(WINLINK)
|
|
|
|
winar: export EXT = dll
|
|
|
|
winar: seglar
|
|
|
|
|
|
|
|
|
2008-03-31 00:14:35 +02:00
|
|
|
cleansubdirs:
|
|
|
|
@for i in $(SUBDIRS); do $(MAKE) clean -C $$i; done
|
|
|
|
|
|
|
|
clean: cleansubdirs
|
2008-02-09 13:43:23 +01:00
|
|
|
rm -f $(OBJECTS)
|
2008-03-31 00:14:35 +02:00
|
|
|
# cd glgui; $(MAKE) clean
|
|
|
|
# cd glmenu; $(MAKE) clean
|
2008-06-08 14:09:56 +02:00
|
|
|
@echo Done cleaning...
|