-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
79 lines (59 loc) · 1.92 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
##
## MAKFILE
## author: Samuel de Lucas Maroto
##
## To compile the game -> 'make compile'
## To run the game -> 'make run'
##
## MACROS ###################################################################
CC = gcc
CFLAGS = -g -Wall -pedantic
OURLIBSC = libs/grafiks.c libs/control.c libs/quest.c libs/player.c libs/body.c libs/permutations.c libs/queue.c libs/randomizer.c libs/musik.c libs/screen.c libs/achievement.c libs/menu.c
OURLIBS = $(OURLIBSC:.c=)
OURLIBSH = $(OURLIBSC:.c=.h)
OURLIBSOBJ = $(OURLIBSC:.c=.o)
## COMPILE THE GAME #########################################################
.PHONY : compile
compile: clean main clear
@echo "#---------------------------"
@echo "# To run the game just execute 'make run' or './main'"
@echo "# Have fun!!!"
## RUN THE GAME #############################################################
.PHONY : run
run:
./main
## MAIN INSTRUCTIONS ########################################################
main: main.o $(OURLIBSOBJ)
@echo "#---------------------------"
@echo "# Generating the game!!! "
@echo " "
$(CC) -o $@ $^ -pthread -lm -Wl,-rpath=$(PWD)/libs/fmod/api/core/lib/x86_64 -L$(PWD)/libs/fmod/api/core/lib/x86_64 -lfmod
@echo " "
main.o: main.c
@echo "#---------------------------"
@echo "# Generating $@ "
@echo " "
$(CC) $(CFLAGS) -c main.c
@echo " "
## LIBS INSTRUCTIONS ########################################################
libs/%.o : libs/%.c libs/%.h
@echo "#---------------------------"
@echo "# Generating $@ "
@echo " "
$(CC) $(CFLAGS) -c libs/$*.c -o libs/$*.o
@echo " "
## CLEANING INSTRUCTIONS ####################################################
.PHONY : clean
clean:
@echo "#---------------------------"
@echo "#Removing object files and executables"
@echo " "
rm -f *.o libs/*.o $(ALLFILES) main
@echo " "
.PHONY : clear
clear:
@echo "#---------------------------"
@echo "#Removing object files"
@echo " "
rm -f *.o libs/*.o
@echo " "