2002-12-05 03:17:12 +00:00
|
|
|
#Makefile for ZEngine
|
2003-10-05 19:21:03 +00:00
|
|
|
#Created and maintained by James Turk
|
|
|
|
#Incremental build optimizations submitted by Atani
|
2002-12-05 03:17:12 +00:00
|
|
|
|
2003-07-28 00:04:02 +00:00
|
|
|
include $(CURDIR)/config
|
2003-07-17 07:48:25 +00:00
|
|
|
#defines the user shouldn't change#
|
2003-07-28 00:04:02 +00:00
|
|
|
INCLUDES = -I$(CURDIR)/include $(SDL_INC_PATH) $(GL_INC_PATH)
|
|
|
|
LIBRARIES = -L$(CURDIR)/lib $(SDL_LIB_PATH) $(GL_LIB_PATH)
|
2003-10-05 19:21:03 +00:00
|
|
|
CPPFLAGS = $(EXTRA_OPTIONS) $(WARN_LEVEL) $(INCLUDES) $(LIBRARIES)
|
|
|
|
CFLAGS = -w
|
2003-07-28 00:04:02 +00:00
|
|
|
LIB_OUT = $(CURDIR)/lib/libZEngineS.a
|
2003-07-15 11:11:25 +00:00
|
|
|
ALL_TESTS = ZFontTest ZMouseTest ZMusicTest ZSoundTest ZTimerTest ZImageTest ZRectTest ZParticleTest
|
2002-12-05 03:17:12 +00:00
|
|
|
|
2003-07-28 00:04:02 +00:00
|
|
|
%.o: $(CURDIR)/src/%.cpp
|
2003-10-05 19:21:03 +00:00
|
|
|
$(CPPC) $(CPPFLAGS) -c $< -o $@
|
2003-07-28 00:04:02 +00:00
|
|
|
|
|
|
|
%.o: $(CURDIR)/src/external/%.cpp
|
2003-10-05 19:21:03 +00:00
|
|
|
$(CPPC) $(CPPFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
%.o: $(CURDIR)/zlib/%.c
|
2003-07-28 00:04:02 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2003-10-05 19:21:03 +00:00
|
|
|
CPP_SOURCES = $(wildcard $(CURDIR)/src/external/*.cpp) \
|
|
|
|
$(wildcard $(CURDIR)/src/*.cpp)
|
|
|
|
C_SOURCES = $(wildcard $(CURDIR)/zlib/*.c)
|
2003-07-17 01:53:07 +00:00
|
|
|
|
2003-10-05 19:21:03 +00:00
|
|
|
#sources with path stripped and .cpp changed to .o
|
|
|
|
OBJECTS = $(notdir $(CPP_SOURCES:.cpp=.o)) $(notdir $(C_SOURCES:.c=.o))
|
2003-07-11 23:06:20 +00:00
|
|
|
|
|
|
|
#build targets#
|
|
|
|
|
2003-07-28 00:04:02 +00:00
|
|
|
all: $(LIB_OUT) tests
|
|
|
|
tests: $(ALL_TESTS)
|
|
|
|
|
|
|
|
$(LIB_OUT): $(OBJECTS)
|
2003-07-15 11:11:25 +00:00
|
|
|
@echo Building $(BUILD_NAME)...
|
|
|
|
$(AR) $(LIB_OUT) $(OBJECTS)
|
|
|
|
@echo Built $(BUILD_NAME).
|
|
|
|
|
2003-07-28 00:04:02 +00:00
|
|
|
$(ALL_TESTS) : $(LIB_OUT)
|
|
|
|
@echo Building $@...
|
2003-10-05 19:21:03 +00:00
|
|
|
$(CPPC) $(CPPFLAGS) $(CURDIR)/test/$@.cpp -o $(CURDIR)/test/bin/$@ $(LIBS)
|
2003-07-28 00:04:02 +00:00
|
|
|
@echo $@ compiled.
|
2003-07-15 11:11:25 +00:00
|
|
|
|
2003-07-28 00:04:02 +00:00
|
|
|
.PHONY: $(ALL_TESTS) install clean veryclean
|
2002-12-05 03:17:12 +00:00
|
|
|
|
|
|
|
install: $(LIB_OUT)
|
|
|
|
mkdir -p $(INSTALL_INC)
|
|
|
|
mkdir -p $(INSTALL_LIB)
|
|
|
|
mkdir -p $(INSTALL_DOC)
|
2003-07-28 00:04:02 +00:00
|
|
|
cp -r $(CURDIR)/include/* $(INSTALL_INC)
|
2002-12-05 03:17:12 +00:00
|
|
|
cp $(LIB_OUT) $(INSTALL_LIB)
|
2003-07-28 00:04:02 +00:00
|
|
|
cp -r $(CURDIR)/doc/html/* $(INSTALL_DOC)
|
2002-12-03 04:11:58 +00:00
|
|
|
|
|
|
|
clean:
|
2003-07-28 00:04:02 +00:00
|
|
|
rm -f $(OBJECTS)
|
2003-07-15 11:11:25 +00:00
|
|
|
@echo All object files removed.
|
2002-12-03 04:11:58 +00:00
|
|
|
|
2003-07-11 23:06:20 +00:00
|
|
|
veryclean:
|
2003-07-28 00:04:02 +00:00
|
|
|
rm -f $(OBJECTS)
|
2003-09-09 21:20:59 +00:00
|
|
|
rm -f $(CURDIR)/test/bin/Z*
|
2003-07-15 11:11:25 +00:00
|
|
|
rm -f $(LIB_OUT)
|
|
|
|
@echo All output files removed.
|
2003-07-28 00:04:02 +00:00
|
|
|
|