public
Description: 2D game API using OpenGL for fast 2D drawing and SDL for everything else [obsolete]
Homepage: http://zengine.sourceforge.net
Clone URL: git://github.com/jamesturk/zengine.git
zengine / makefile
100644 65 lines (49 sloc) 1.702 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#Makefile for ZEngine
#Created and maintained by James Turk
#Incremental build optimizations submitted by Atani
 
include $(CURDIR)/config
#defines the user shouldn't change#
INCLUDES = -I$(CURDIR)/include $(SDL_INC_PATH) $(GL_INC_PATH)
LIBRARIES = -L$(CURDIR)/lib $(SDL_LIB_PATH) $(GL_LIB_PATH)
CPPFLAGS = $(EXTRA_OPTIONS) $(WARN_LEVEL) $(INCLUDES) $(LIBRARIES)
CFLAGS = -w
LIB_OUT = $(CURDIR)/lib/libZEngineS.a
ALL_TESTS = ZFontTest ZMouseTest ZMusicTest ZSoundTest ZTimerTest ZImageTest ZRectTest ZParticleTest
 
%.o: $(CURDIR)/src/%.cpp
$(CPPC) $(CPPFLAGS) -c $< -o $@
 
%.o: $(CURDIR)/src/external/%.cpp
$(CPPC) $(CPPFLAGS) -c $< -o $@
 
%.o: $(CURDIR)/zlib/%.c
$(CC) $(CFLAGS) -c $< -o $@
 
CPP_SOURCES = $(wildcard $(CURDIR)/src/external/*.cpp) \
$(wildcard $(CURDIR)/src/*.cpp)
C_SOURCES = $(wildcard $(CURDIR)/zlib/*.c)
 
#sources with path stripped and .cpp changed to .o
OBJECTS = $(notdir $(CPP_SOURCES:.cpp=.o)) $(notdir $(C_SOURCES:.c=.o))
 
#build targets#
 
all: $(LIB_OUT) tests
tests: $(ALL_TESTS)
 
$(LIB_OUT): $(OBJECTS)
@echo Building $(BUILD_NAME)...
$(AR) $(LIB_OUT) $(OBJECTS)
@echo Built $(BUILD_NAME).
 
$(ALL_TESTS) : $(LIB_OUT)
@echo Building $@...
$(CPPC) $(CPPFLAGS) $(CURDIR)/test/$@.cpp -o $(CURDIR)/test/bin/$@ $(LIBS)
@echo $@ compiled.
 
.PHONY: $(ALL_TESTS) install clean veryclean
 
install: $(LIB_OUT)
mkdir -p $(INSTALL_INC)
mkdir -p $(INSTALL_LIB)
mkdir -p $(INSTALL_DOC)
cp -r $(CURDIR)/include/* $(INSTALL_INC)
cp $(LIB_OUT) $(INSTALL_LIB)
cp -r $(CURDIR)/doc/html/* $(INSTALL_DOC)
 
clean:
rm -f $(OBJECTS)
@echo All object files removed.
 
veryclean:
rm -f $(OBJECTS)
rm -f $(CURDIR)/test/bin/Z*
rm -f $(LIB_OUT)
@echo All output files removed.