diff --git a/config b/config new file mode 100755 index 0000000..1046530 --- /dev/null +++ b/config @@ -0,0 +1,31 @@ +#Config file for ZEngine# + #Edit only this file# + +BUILD_NAME=gewi-0.2.0 + + ###Cygwin### +#EXE=.exe +#GL_LIB_NAME=OpenGL32 +#GL_INC_PATH=-I/usr/include/w32api/GL +#GL_LIB_PATH=-L/lib/w32api +#EXTRA_OPTIONS=-mno-cygwin -O2 + + ###Linux### +GL_LIB_NAME=GL +EXTRA_OPTIONS=-O2 + +##Define compiler commands: +CC=g++ +AR=ar rcs + +###Define compiler options: +WARN_LEVEL=-W -Wall +ZE_INC_PATH=-I/usr/include/ZEngine-0.8.4 +SDL_INC_PATH=-I/usr/include/SDL +SDL_LIB_PATH= +LIBS=-lgewiS -lZEngineS -lSDL_mixer -lSDL_image -lSDL_ttf -lSDLmain -lSDL -l$(GL_LIB_NAME) + +##Define install location: +INSTALL_INC= /usr/include/$(BUILD_NAME) +INSTALL_LIB= /usr/lib +INSTALL_DOC= /usr/share/doc/$(BUILD_NAME) diff --git a/makefile b/makefile new file mode 100755 index 0000000..6f5d80a --- /dev/null +++ b/makefile @@ -0,0 +1,52 @@ +#Makefile for ZEngine + +include ./config +#defines the user shouldn't change# +INCLUDES = -I./include $(SDL_INC_PATH) $(GL_INC_PATH) $(ZE_INC_PATH) +LIBRARIES = -L./lib $(SDL_LIB_PATH) $(GL_LIB_PATH) +CFLAGS = $(EXTRA_OPTIONS) $(WARN_LEVEL) $(INCLUDES) $(LIBRARIES) +LIB_OUT = ./lib/libgewiS.a +ALL_TESTS = gewiTest00 + +SOURCES = $(wildcard src/*.cpp) + +#SOURCES with path stripped and .cpp changed to .o +OBJECTS = $(notdir $(SOURCES:.cpp=.o)) + +#build targets# + +$(LIB_OUT): $(SOURCES) + @echo Building $(BUILD_NAME)... + $(CC) $(CFLAGS) -c $(SOURCES) + $(AR) $(LIB_OUT) $(OBJECTS) + @echo Built $(BUILD_NAME). + +./test/bin/gewiTest00$(EXE) : $(LIB_OUT) ./test/gewiTest00.cpp + @echo Building gewiTest00... + $(CC) $(CFLAGS) ./test/gewiTest00.cpp -o ./test/bin/gewiTest00$(EXE) $(LIBS) + @echo gewiTest00 compiled. + +.PHONY: $(ALL_TESTS) tests all install clean veryclean + +gewiTest00: ./test/bin/gewiTest00$(EXE) + +tests: $(ALL_TESTS) +all: $(LIB_OUT) $(ALL_TESTS) + +install: $(LIB_OUT) + mkdir -p $(INSTALL_INC) + mkdir -p $(INSTALL_LIB) + mkdir -p $(INSTALL_DOC) + cp -r ./include/* $(INSTALL_INC) + cp $(LIB_OUT) $(INSTALL_LIB) + cp -r ./doc/html/* $(INSTALL_DOC) + +clean: + rm -f *.o + @echo All object files removed. + +veryclean: + rm -f *.o + rm -f ./test/bin/*.exe + rm -f $(LIB_OUT) + @echo All output files removed.