-
Notifications
You must be signed in to change notification settings - Fork 42
/
Makefile
46 lines (30 loc) · 900 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
DIR_Config = ./lib/Config
DIR_EPD = ./lib/e-Paper
DIR_FONTS = ./lib/Fonts
DIR_GUI = ./lib/GUI
DIR_Examples = ./examples
DIR_BIN = ./bin
OBJ_C = $(wildcard ${DIR_Config}/*.c ${DIR_EPD}/*.c ${DIR_FONTS}/*.c ${DIR_GUI}/*.c ${DIR_Examples}/*.c )
OBJ_O = $(patsubst %.c,${DIR_BIN}/%.o,$(notdir ${OBJ_C}))
TARGET = epd
CC = gcc
MSG = -g -O0 -Wall
DEBUG = -D USE_DEBUG
STD = -std=c99
CFLAGS += $(MSG) $(DEBUG) $(STD)
LIB = -lbcm2835 -lm -lrt -lpthread
${TARGET}:${OBJ_O}
$(CC) $(CFLAGS) $(OBJ_O) -o $@ $(LIB)
${DIR_BIN}/%.o:$(DIR_Config)/%.c
$(CC) $(CFLAGS) -c $< -o $@
${DIR_BIN}/%.o:$(DIR_EPD)/%.c
$(CC) $(CFLAGS) -c $< -o $@
${DIR_BIN}/%.o:$(DIR_FONTS)/%.c
$(CC) $(CFLAGS) -c $< -o $@
${DIR_BIN}/%.o:$(DIR_GUI)/%.c
$(CC) $(CFLAGS) -c $< -o $@
${DIR_BIN}/%.o:$(DIR_Examples)/%.c
$(CC) $(CFLAGS) -c $< -o $@
clean :
rm $(DIR_BIN)/*.*
rm $(TARGET)