New makefile system.
This commit is contained in:
parent
43cd7a1f2c
commit
055b14985c
27
config
Normal file
27
config
Normal file
@ -0,0 +1,27 @@
|
||||
#Config file for ZEngine#
|
||||
#Edit only this file#
|
||||
|
||||
BUILD= ZEngine-0.8.0
|
||||
|
||||
#Define compiler commands:
|
||||
CC= g++
|
||||
AR= ar rcs
|
||||
|
||||
#Define compiler options:
|
||||
WARN=-W -Wall
|
||||
LIBS=-lZEngineS -lSDL_mixer -lSDL_image -lSDL_ttf -lSDLmain -lSDL -lGL
|
||||
INC_PATH=-I/usr/include/SDL
|
||||
|
||||
#Define install location:
|
||||
INSTALL_ROOT= /usr/local
|
||||
INSTALL_INC= $(INSTALL_ROOT)/include/$(BUILD)
|
||||
INSTALL_LIB= $(INSTALL_ROOT)/lib
|
||||
INSTALL_DOC= $(INSTALL_ROOT)/doc/$(BUILD)
|
||||
|
||||
############change nothing below this line#################
|
||||
LIB= $(ZE)/lib
|
||||
SRC= $(ZE)/src
|
||||
TEST = $(ZE)/test
|
||||
|
||||
INCLUDE_PATH = -I$(ZE)/include $(INC_PATH)
|
||||
CFLAGS = -O2 $(WARN) $(INCLUDE_PATH)
|
43
makefile
43
makefile
@ -1,22 +1,37 @@
|
||||
CC=g++
|
||||
CFLAGS=-O2 -W -Wall -I"/usr/include/SDL" -I"/home/James/ZEngine-dev/include" -L"/usr/lib/SDL" -L"/home/James/ZEngine-dev/lib"
|
||||
LIBS=-lZEngineS -lSDL_mixer -lSDL_image -lSDL_ttf -lSDLmain -lSDL -lGL
|
||||
#Makefile for ZEngine
|
||||
|
||||
ZEngineS.a: src/ZE_ZTimer.cpp src/ZE_ZImage.cpp src/ZE_ZFont.cpp src/ZE_ZMusic.cpp src/ZE_ZConfigFile.cpp src/ZE_ZSound.cpp src/ZE_ZMusic.cpp src/ZE_ZRect.cpp src/ZE_Error.cpp src/ZE_ZEngine.cpp src/external/SDLGL_Util.cpp
|
||||
$(CC) $(CFLAGS) -c src/ZE_ZTimer.cpp src/ZE_ZImage.cpp src/ZE_ZFont.cpp src/ZE_ZMusic.cpp src/ZE_ZConfigFile.cpp src/ZE_ZSound.cpp src/ZE_ZMusic.cpp src/ZE_ZRect.cpp src/ZE_Error.cpp src/ZE_ZEngine.cpp src/external/SDLGL_Util.cpp
|
||||
ar rcs lib/libZEngineS.a ZE_ZTimer.o ZE_ZImage.o ZE_ZFont.o ZE_ZMusic.o ZE_ZConfigFile.o ZE_ZSound.o ZE_ZMusic.o ZE_Error.o ZE_ZRect.o ZE_ZEngine.o SDLGL_Util.o
|
||||
ZE = .
|
||||
include $(ZE)/config
|
||||
|
||||
tests: test/ZFontTest.cpp test/ZMouseTest.cpp test/ZMusicTest.cpp test/ZSoundTest.cpp test/ZTimerTest.cpp test/ZImageTest.cpp test/ZRectTest.cpp
|
||||
$(CC) $(CFLAGS) test/ZFontTest.cpp -o test/bin/ZFontTest $(LIBS)
|
||||
$(CC) $(CFLAGS) test/ZMouseTest.cpp -o test/bin/ZMouseTest $(LIBS)
|
||||
$(CC) $(CFLAGS) test/ZMusicTest.cpp -o test/bin/ZMusicTest $(LIBS)
|
||||
$(CC) $(CFLAGS) test/ZSoundTest.cpp -o test/bin/ZSoundTest $(LIBS)
|
||||
$(CC) $(CFLAGS) test/ZTimerTest.cpp -o test/bin/ZTimerTest $(LIBS)
|
||||
$(CC) $(CFLAGS) test/ZImageTest.cpp -o test/bin/ZImageTest $(LIBS)
|
||||
$(CC) $(CFLAGS) test/ZRectTest.cpp -o test/bin/ZRectTest $(LIBS)
|
||||
LIB_OUT=$(ZE)/lib/libZEngineS.a
|
||||
|
||||
libZEngineS.a: $(SRC)/ZE_ZTimer.cpp $(SRC)/ZE_ZImage.cpp $(SRC)/ZE_ZFont.cpp $(SRC)/ZE_ZMusic.cpp $(SRC)/ZE_ZConfigFile.cpp $(SRC)/ZE_ZSound.cpp $(SRC)/ZE_ZMusic.cpp $(SRC)/ZE_ZRect.cpp $(SRC)/ZE_Error.cpp $(SRC)/ZE_ZEngine.cpp $(SRC)/external/SDLGL_Util.cpp
|
||||
$(CC) $(CFLAGS) -c $(SRC)/ZE_ZTimer.cpp $(SRC)/ZE_ZImage.cpp $(SRC)/ZE_ZFont.cpp $(SRC)/ZE_ZMusic.cpp $(SRC)/ZE_ZConfigFile.cpp $(SRC)/ZE_ZSound.cpp $(SRC)/ZE_ZMusic.cpp $(SRC)/ZE_ZRect.cpp $(SRC)/ZE_Error.cpp $(SRC)/ZE_ZEngine.cpp $(SRC)/external/SDLGL_Util.cpp
|
||||
$(AR) $(LIB_OUT) ZE_ZTimer.o ZE_ZImage.o ZE_ZFont.o ZE_ZMusic.o ZE_ZConfigFile.o ZE_ZSound.o ZE_ZMusic.o ZE_Error.o ZE_ZRect.o ZE_ZEngine.o SDLGL_Util.o
|
||||
|
||||
tests: $(TEST)/ZFontTest.cpp $(TEST)/ZMouseTest.cpp $(TEST)/ZMusicTest.cpp $(TEST)/ZSoundTest.cpp $(TEST)/ZTimerTest.cpp $(TEST)/ZImageTest.cpp $(TEST)/ZRectTest.cpp
|
||||
$(CC) $(CFLAGS) -L$(ZE)/lib $(TEST)/ZFontTest.cpp -o $(TEST)/bin/ZFontTest $(LIBS)
|
||||
$(CC) $(CFLAGS) -L$(ZE)/lib $(TEST)/ZMouseTest.cpp -o $(TEST)/bin/ZMouseTest $(LIBS)
|
||||
$(CC) $(CFLAGS) -L$(ZE)/lib $(TEST)/ZMusicTest.cpp -o $(TEST)/bin/ZMusicTest $(LIBS)
|
||||
$(CC) $(CFLAGS) -L$(ZE)/lib $(TEST)/ZSoundTest.cpp -o $(TEST)/bin/ZSoundTest $(LIBS)
|
||||
$(CC) $(CFLAGS) -L$(ZE)/lib $(TEST)/ZTimerTest.cpp -o $(TEST)/bin/ZTimerTest $(LIBS)
|
||||
$(CC) $(CFLAGS) -L$(ZE)/lib $(TEST)/ZImageTest.cpp -o $(TEST)/bin/ZImageTest $(LIBS)
|
||||
$(CC) $(CFLAGS) -L$(ZE)/lib $(TEST)/ZRectTest.cpp -o $(TEST)/bin/ZRectTest $(LIBS)
|
||||
|
||||
install: $(LIB_OUT)
|
||||
mkdir -p $(INSTALL_ROOT)
|
||||
mkdir -p $(INSTALL_INC)
|
||||
mkdir -p $(INSTALL_LIB)
|
||||
mkdir -p $(INSTALL_DOC)
|
||||
cp -r $(ZE)/include/* $(INSTALL_INC)
|
||||
cp $(LIB_OUT) $(INSTALL_LIB)
|
||||
cp -r $(ZE)/doc/html/* $(INSTALL_DOC)
|
||||
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
rm *.o
|
||||
|
||||
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
CC=g++
|
||||
CFLAGS=-O2 -W -Wall -pedantic -I"c:/zengine-dev/include/" -L"c:/zengine-dev/lib/"
|
||||
LIBS=-lmingw32 -mwindows -lZEngine -lSDL_mixer -lSDL_ttf -lSDLmain -lSDL -lGL
|
||||
|
||||
libZEngineS.a: src/ZE_ZTimer.cpp src/ZE_ZImage.cpp src/ZE_ZFont.cpp src/ZE_ZMusic.cpp src/ZE_ZConfigFile.cpp src/ZE_ZSound.cpp src/ZE_ZMusic.cpp src/ZE_ZRect.cpp src/ZE_Error.cpp src/ZE_ZEngine.cpp src/external/SDLGL_Util.cpp
|
||||
$(CC) $(CFLAGS) -c src/ZE_ZTimer.cpp src/ZE_ZImage.cpp src/ZE_ZFont.cpp src/ZE_ZMusic.cpp src/ZE_ZConfigFile.cpp src/ZE_ZSound.cpp src/ZE_ZMusic.cpp src/ZE_ZRect.cpp src/ZE_Error.cpp src/ZE_ZEngine.cpp src/external/SDLGL_Util.cpp
|
||||
ar rcs lib/libZEngineS.a ZE_ZTimer.o ZE_ZImage.o ZE_ZFont.o ZE_ZMusic.o ZE_ZConfigFile.o ZE_ZSound.o ZE_ZMusic.o ZE_Error.o ZE_ZRect.o ZE_ZEngine.o SDLGL_Util.o
|
||||
|
||||
tests: test/ZFontTest.cpp test/ZMouseTest.cpp test/ZMusicTest.cpp test/ZSoundTest.cpp test/ZTimerTest.cpp test/ZImageTest.cpp test/ZRectTest.cpp
|
||||
$(CC) $(CFLAGS) test/ZFontTest.cpp -o test/bin/ZFontTest $(LIBS)
|
||||
$(CC) $(CFLAGS) test/ZMouseTest.cpp -o test/bin/ZMouseTest $(LIBS)
|
||||
$(CC) $(CFLAGS) test/ZMusicTest.cpp -o test/bin/ZMusicTest $(LIBS)
|
||||
$(CC) $(CFLAGS) test/ZSoundTest.cpp -o test/bin/ZSoundTest $(LIBS)
|
||||
$(CC) $(CFLAGS) test/ZTimerTest.cpp -o test/bin/ZTimerTest $(LIBS)
|
||||
$(CC) $(CFLAGS) test/ZImageTest.cpp -o test/bin/ZImageTest $(LIBS)
|
||||
$(CC) $(CFLAGS) test/ZRectTest.cpp -o test/bin/ZRectTest $(LIBS)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
rm *.o
|
@ -21,8 +21,8 @@ windows the folder vc7 contains project files for use, and if you are using
|
||||
mingw or cygwin you can replace the linux makefile with makefile.mingw32.
|
||||
-If you are using VC++ you will need to add the path to the dependencies (SDL
|
||||
and others) as well as the path to ZEngine before building.
|
||||
-If you are using gcc on any system you will need to modify the makefile you
|
||||
are using to set the proper include and lib paths.
|
||||
-If you are using gcc on any OS you need to change configure (not the
|
||||
makefile) to meet your needs then run make.
|
||||
If you are having a problem building ask on http://conceptofzero.net/forums.
|
||||
|
||||
Using ZEngine:
|
||||
|
Loading…
Reference in New Issue
Block a user