forked from hathach/tinyusb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (52 loc) · 1.13 KB
/
Makefile
File metadata and controls
63 lines (52 loc) · 1.13 KB
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
BDIR = b/
INC = $(wildacrd *.h)
SRC = $(wildcard *.c)
OBJ = $(SRC:%.c=$(BDIR)/%.o)
EXE = $(BDIR)/foo
#---------------------------------------------------------------------------
aBLK=\e[30m
aRED=\e[31m
aGRN=\e[32m
aYEL=\e[33m
aBLU=\e[34m
aMAG=\e[35m
aCYN=\e[36m
aWHT=\e[37m
aONBLK=\e[40m
aONRED=\e[41m
aONGRN=\e[42m
aONYEL=\e[43m
aONBLU=\e[44m
aONMAG=\e[45m
aONCYN=\e[46m
aONWHT=\e[47m
aNRM=\e[0m
aBRT=\e[1m
aDIM=\e[2m
aUNL=\e[4m
aFLS=\e[5m
aINV=\e[7m
aHID=\e[8m
aERROR=$(aBRT)$(aYEL)$(aONRED)
MD = mkdir -p
ECHO = /bin/echo -e
CC = gcc -c -g
tPRE =$(aNRM)$(aBRT):-----[
tPOST=$(aNRM)$(aBRT)]-----:$(aNRM)
#---------------------------------------------------------------------------
all: common/tusb_common.h $(OBJ)
gcc -o $(EXE) $(OBJ)
$(BDIR)/%.o : %.c
@$(ECHO) "$(tPRE)$(aCYN) COMPILE: $@ $(tPOST)"
@$(MD) $(BDIR)
$(CC) -o $@ $(notdir $(<:.d=.c))
common/tusb_common.h:
mkdir -p common
@$(ECHO) "#ifndef TUSB_COMMON_" >$@
@$(ECHO) "#define TUSB_COMMON_" >>$@
@$(ECHO) "" >>$@
@$(ECHO) "#define TU_ATTR_PACKED __attribute__ ((packed))" >>$@
@$(ECHO) "" >>$@
@$(ECHO) "#endif" >>$@
clean:
rm -rf $(BDIR) common