-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
47 lines (36 loc) · 973 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
39
40
41
42
43
44
45
46
47
CC=gcc
CFLAGS=-std=gnu99 -mfloat-abi=hard -mfpu=vfpv3-d16 -march=armv7-a -mthumb -s -Os
INCLUDES=-I./include
LFLAGS=
LIBS=
MAINSRCS=gonzales.c fast-gpio.c
BENCHSRCS=bench.c fast-gpio.c
DHTSRCS=dhtsensor.c fast-gpio.c
MAINOBJS=$(MAINSRCS:.c=.o)
BENCHOBJS=$(BENCHSRCS:.c=.o)
DHTOBJS=$(DHTSRCS:.c=.o)
LSOC=
DLSOC=
USELIBSOC=0
ifeq ($(USELIBSOC), 1)
LSOC=-lsoc
DLSOC=-D_WITH_LIBSOC
endif
MAIN=gonzales
BENCH=bench
DHT=dhtsensor
.PHONY: depend clean
all: $(MAIN) $(BENCH) $(DHT)
$(MAIN): $(MAINOBJS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(MAIN) $(MAINOBJS) $(LFLAGS) $(LIBS)
$(BENCH): $(BENCHOBJS)
$(CC) $(LSOC) $(CFLAGS) $(INCLUDES) -o $(BENCH) $(BENCHOBJS) $(LFLAGS) $(LIBS)
$(DHT): $(DHTOBJS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(DHT) $(DHTOBJS) $(LFLAGS) $(LIBS)
.c.o:
$(CC) $(DLSOC) $(CFLAGS) $(INCLUDES) -c $< -o $@
clean:
$(RM) *.o *~ $(MAIN) $(BENCH)
depend: $(MAINSRCS) $(BENCHSRCS)
makedepend $(INCLUDES) $^
# DO NOT DELETE THIS LINE -- make depend needs it