-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
38 lines (27 loc) · 945 Bytes
/
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
GM=./gameData
SV=./serverData
OBJG=./gameData/gameObject
OBJS=./serverData/serverObject
all: $(OBJG) game $(OBJS) server
#Creating folders
$(OBJG):
mkdir -p $(OBJG)
$(OBJS):
mkdir -p $(OBJS)
#Dynamik linking
game.o: $(OBJG)/g_main.o $(OBJG)/g_startup.o
gcc -g -Wall -pedantic $^ -o $@ -lncurses
server.o: $(OBJS)/s_main.o $(OBJS)/s_startup.o
gcc -g -Wall -pedantic $^ -o $@ -lncurses
#With debugging symbols
$(OBJG)/g_main.o: $(GM)/game.c $(GM)/game_startup.h $(GM)/game_player_info.h
gcc -g -c -Wall -pedantic $< -o $@
$(OBJG)/g_startup.o: $(GM)/game_startup.c $(GM)/game_startup.h
gcc -g -c -Wall -pedantic $< -o $@
$(OBJS)/s_main.o: $(SV)/server.c $(SV)/server_startup.h $(SV)/server_player_info.h
gcc -g -c -Wall -pedantic $< -o $@
$(OBJS)/s_startup.o: $(SV)/server_startup.c $(SV)/server_startup.h $(SV)/server_player_info.h
gcc -g -c -Wall -pedantic $< -o $@
.PHONY: clean
clean:
-rm game $(OBJG)/*.o server $(OBJS)/*.o