-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
48 lines (40 loc) · 1.1 KB
/
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
##############################################################################
# Variables
GCC = gcc
HUAWEI_DIR = ./huawei/
AT_DIR = ./huawei/at
CFLAGS = -I. -I$(HUAWEI_DIR) -I$(AT_DIR)
# Output
OUTPROG = amachine
# Run variables
CMDS_DEV = /dev/ttyUSB0
AUDIO_DEV = /dev/ttyUSB1
AUDIO_FILE = ./audio/fran.wav
RUN_CMD = ./$(OUTPROG) $(CMDS_DEV) $(AUDIO_DEV) $(AUDIO_FILE)
# Sources files
SRC_FILES = huawei/at/at_a.c huawei/at/at_chup.c huawei/at/at_clcc.c \
huawei/at/at_cvoice.c huawei/at/at_d.c huawei/at/at_ddsetex.c \
util.c huawei/modem.c main.c
# Generated object files
O_FILES = $(SRC_FILES:%.c=%.o)
# Generated auto-dependency files
D_FILES = $(SRC_FILES:%.c=%.d)
##############################################################################
# Targets
# Make all
all: $(OUTPROG)
# Make all and run
run: $(OUTPROG)
$(RUN_CMD)
# Object generation
%.o: %.c
$(GCC) $(CFLAGS) -MMD -MP -o $@ -c $<
# Include dependencies
-include $(D_FILES)
# Output generation
$(OUTPROG): $(O_FILES)
$(GCC) -o $@ $^
.PHONY: clean
# Clean all
clean:
rm -f *.o $(O_FILES) $(D_FILES) $(OUTPROG)