-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (45 loc) · 1.96 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
#-----------------------------------------------------------------------
# This is the Makefile for compilation of Autonomous Driving project
#-----------------------------------------------------------------------
#-----------------------------------------------------------------------
# Target file to be compiled by default
#-----------------------------------------------------------------------
MAIN = autonomous_driving
#-----------------------------------------------------------------------
# CC is the compiler to be used
#-----------------------------------------------------------------------
CC = gcc
#-----------------------------------------------------------------------
# CFLAGS are the options passed to the compiler
#-----------------------------------------------------------------------
CFLAGS = -Wall -lpthread -lrt
#-----------------------------------------------------------------------
# Custom libraries linking
#-----------------------------------------------------------------------
PTASK_LIB = ptask
TLIB = tlib
QLEARN_LIB = qlearn
OBJS = $(MAIN).o $(PTASK_LIB).o $(TLIB).o $(QLEARN_LIB).o
#-----------------------------------------------------------------------
# LIBS are the external libraried to be used
#-----------------------------------------------------------------------
LIBS = -lpthread -lrt -lm `allegro-config --libs`
#-----------------------------------------------------------------------
# Dependencies
#-----------------------------------------------------------------------
$(MAIN): $(OBJS)
$(CC) $(CFLAGS) -o $(MAIN) $(OBJS) $(LIBS)
MAIN_PATH = src/$(MAIN)
$(MAIN).o: $(MAIN_PATH).c
$(CC) $(CFLAGS) -c $(MAIN_PATH).c
PTASK_PATH = libs/ptask/$(PTASK_LIB)
$(PTASK_LIB).o: $(PTASK_PATH).c
$(CC) $(CFLAGS) -c $(PTASK_PATH).c
TLIB_PATH = libs/tlib/$(TLIB)
$(TLIB).o: $(TLIB_PATH).c
$(CC) $(CFLAGS) -c $(TLIB_PATH).c
QLEARN_PATH = libs/qlearn/$(QLEARN_LIB)
$(QLEARN_LIB).o: $(QLEARN_PATH).c
$(CC) $(CFLAGS) -c $(QLEARN_PATH).c
clean:
rm -rf *.o $(MAIN)