-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
51 lines (44 loc) · 910 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
48
49
50
51
#
# File:
# Makefile
#
# Description:
# Makefile for compilation of dataDecode program
#
#
DEBUG ?= 1
QUIET ?= 1
#
ifeq ($(QUIET),1)
Q = @
else
Q =
endif
CROSS_COMPILE =
CC = $(CROSS_COMPILE)gcc -m32
AR = ar
RANLIB = ranlib
INCS = -I.
CFLAGS = -L.
ifeq ($(DEBUG),1)
CFLAGS += -Wall -Wno-unused -g
endif
SRC = $(wildcard *.c)
SRC2 = $(filter-out dataDecode.c,${SRC})
DEPS = $(SRC2:.c=.d)
PROGS = $(SRC2:.c=)
all: $(PROGS)
clean distclean:
@rm -f $(PROGS) *~ $(OBJS) $(DEPS)
%: %.c
@echo " CC $@"
${Q}$(CC) $(CFLAGS) $(INCS) -DDATADECODE=$(@:dec=DataDecode) \
-include $(@).h -o $@ $< dataDecode.c
%.d: %.c
@echo " DEP $@"
@set -e; rm -f $@; \
$(CC) -MM $(INCS) -include $(@:.d=.h) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
-include $(DEPS)
.PHONY: all clean distclean