libsegl/Makefile

65 lines
1.9 KiB
Makefile
Executable File

CC = g++
AR = ar
OBJECTS = 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
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
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
SUBDIRS = glgui glmenu model
SUBDIROBJECTS = glgui/*.o glmenu/*.o model/*.o
VERSION = 0.1.1
LIBVERSION = 1
LIBNAME = libsegl
EXT = so.$(LIBVERSION)
.PHONY: windows
seglar: $(OBJECTS) subdirs
rm -f $(LIBNAME).a
$(AR) rcs $(LIBNAME).a $(OBJECTS) $(SUBDIROBJECTS)
# ranlib $(LIBNAME).a
lib: LINKER = $(LINKER)
lib: $(OBJECTS) subdirs
$(CC) -o $(LIBNAME).$(EXT) $(OBJECTS) $(SUBDIROBJECTS) $(LIBLINK)
subdirs:
@for i in $(SUBDIRS); do $(MAKE) CC="$(CC)" AR="$(AR)" OBJOPT="$(OBJOPT)" -C $$i; done
%.o: %.cpp %.h
$(CC) $(OBJOPT) $<
glgui/glgui.a:
cd glgui; $(MAKE);
glmenu/glmenu.a:
cd glmenu; $(MAKE);
testprog: seglar testprog.o
g++ `sdl-config --libs` -lSDL_image -lGL -lGLU testprog.o -o testprog $(LIBNAME).a
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
cleansubdirs:
@for i in $(SUBDIRS); do $(MAKE) clean -C $$i; done
clean: cleansubdirs
rm -f $(OBJECTS)
# cd glgui; $(MAKE) clean
# cd glmenu; $(MAKE) clean
@echo Done cleaning...