-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
61 lines (51 loc) · 1.27 KB
/
Makefile
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
CC= g++ -std=c++0x
OS=linux
MAKE=make
DIR_BUILD=build
INCLUDE= -Iinclude
MACRO=-DDEBUG
EXEC=fhtagn
LOG="Tool : "${CC}"\r\nMacros : "${MACRO}"\r\nTarget : "${DIR_BUILD}/${EXEC}"\r\n"
main: init
@clear;clear
@echo ${LOG}
@${CC} -g -o ${DIR_BUILD}/${EXEC} \
src/main.cpp \
${DIR_BUILD}/lua.so \
${DIR_BUILD}/dice.so \
${INCLUDE} ${MACRO};
init: dice.so core.so lua.so file.so
@if [ ! -d ${DIR_BUILD} ]; then mkdir ${DIR_BUILD}; fi
# Modules
lua.so:
@${CC} -shared -o ${DIR_BUILD}/lua.so \
src/l*.c \
src/LuaClass.cpp \
${INCLUDE} ${MACRO}
dice.so:
@${CC} -shared -o ${DIR_BUILD}/dice.so \
src/Dice.cpp \
${INCLUDE} ${MACRO}
core.so:
@${CC} -shared -o ${DIR_BUILD}/core.so \
src/Entity.cpp \
src/TheSim.cpp \
${INCLUDE} ${MACRO}
file.so:
@${CC} -shared -o ${DIR_BUILD}/file.so \
src/File.cpp \
${INCLUDE} ${MACRO}
# Test
test: dice.so
@clear
@if [ ! -d ${DIR_BUILD} ]; then mkdir ${DIR_BUILD}; fi
@${CC} -g -o ${DIR_BUILD}/test src/test.cpp \
${DIR_BUILD}/lua.so \
${DIR_BUILD}/dice.so \
${DIR_BUILD}/core.so \
${INCLUDE} ${MACRO}
@./${DIR_BUILD}/test
# Clean
clean:
@clear;clear
@if [ -d ${DIR_BUILD} ]; then rm -r ${DIR_BUILD}; fi