-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (27 loc) · 711 Bytes
/
Makefile
File metadata and controls
39 lines (27 loc) · 711 Bytes
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
CC = gcc
TARGET = racetrack-controllers
SRCDIR = src
OBJDIR = obj
INCDIR = include
TARGETDIR = bin
# -g adds debugging information
# -Wall turns on all warnings
CFLAGS= -g -Wall
# linker options (which libraries to use)
LDFLAGS = -ltensorflow
SRC = $(wildcard $(SRCDIR)/*.c)
OBJ = $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
# includes
INCFLAGS = $(addprefix -I, $(INCDIR))
all: $(TARGET)
$(TARGET): $(OBJ)
@mkdir -p $(TARGETDIR)
$(CC) $(LDFLAGS) -o $(TARGETDIR)/$(TARGET) $^
-include $(OBJ:.o=.d)
$(OBJDIR)/%.o: $(SRCDIR)/%.c
@mkdir -p $(OBJDIR)
$(CC) $(CFLAGS) $(INCFLAGS) -c $< -o $@
$(CC) -MM $(CFLAGS) $(INCFLAGS) $(SRCDIR)/$*.c > $(OBJDIR)/$*.d
.PHONY: clean
clean:
rm -rf $(OBJDIR) $(TARGETDIR)