forked from evilpete/insteonrf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
105 lines (68 loc) · 2.15 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
UNAME = `uname`
CC=gcc
# ifeq ($(UNAME),Linux)
# CC=gcc-4.7
# endif
# .if ${UNAME}=="FreeBSD"
# CC=gcc47
# .endif
# ifeq ($(UNAME),FreeBSD)
# CC=gcc47
# endif
MKDIR_P = mkdir -p
OBJECTS_DIR=Obj
SOURCE_DIR=Src
CFLAGS+=-ggdb -O2 -Wall
LDFLAGS+=-ggdb
LINTFLAGS=-g -n -u -z
TESTWAV=Dat/41802513110D2711018C00.dat
all: directories fsk2_demod rf_clip
if [ -d "MStar_lock" ]; then ( cd "MStar_lock" ; make ); fi
.PHONY: directories
directories: ${OBJECTS_DIR} ${SOURCE_DIR}
${OUT_DIR}:
${MKDIR_P} ${OUT_DIR}
fsk2_mod: $(OBJECTS_DIR)/fsk2_mod.o
$(CC) $(LDFLAGS) -O2 -pipe $+ -o $@ -lm -lliquid
fsk2_demod: $(OBJECTS_DIR)/fsk2_demod.o $(OBJECTS_DIR)/fxpt_atan2.o
$(CC) $(LDFLAGS) -O2 -pipe $+ -o $@ -lm
# $(CC) $(LDFLAGS) -O2 -pipe $< $(OBJECTS_DIR)/fxpt_atan2.o -o $@ -lm
rf_clip: $(OBJECTS_DIR)/rf_clip.o
$(CC) $(LDFLAGS) -O2 -pipe $< -o $@
########## 8 bit
$(OBJECTS_DIR)/rf_clip.o: ${SOURCE_DIR}/rf_clip.c
$(CC) -g -c $(CFLAGS) -o $@ $<
$(OBJECTS_DIR)/fxpt_atan2.o: ${SOURCE_DIR}/fxpt_atan2.c
$(CC) -g -c $(CFLAGS) -o $@ $<
$(OBJECTS_DIR)/fsk2_mod.o: ${SOURCE_DIR}/fsk2_mod.c
$(CC) -g -c $(CFLAGS) -o $@ $< -I/usr/local/include/liquid
$(OBJECTS_DIR)/fsk2_demod.o: ${SOURCE_DIR}/fsk2_demod.c
$(CC) -g -c $(CFLAGS) -o $@ $<
##########
$(OBJECTS_DIR)/insteon_lib.o: ${SOURCE_DIR}/insteon_lib.c
$(CC) -g -c $(CFLAGS) -o $@ $<
$(OBJECTS_DIR)/convert.o: ${SOURCE_DIR}/convert.c
$(CC) -g -c $(CFLAGS) -o $@ $<
$(OBJECTS_DIR)/convert_lib.o: ${SOURCE_DIR}/convert_lib.c
$(CC) -g -c $(CFLAGS) -o $@ $<
convert: $(OBJECTS_DIR)/convert.o $(OBJECTS_DIR)/convert_lib.o
$(CC) $(LDFLAGS) -O2 -pipe $^ -o $@
insteon_pkt_crc: insteon_pkt_crc.o $(OBJECTS_DIR)/insteon_lib.o
$(CC) $(LDFLAGS) -O2 -pipe $^ -o $@
$(OBJECTS_DIR):
@mkdir $(OBJECTS_DIR)
lint:
@lint $(LINTFLAGS) ${SOURCE_DIR}/fsk2_demod.c
@lint $(LINTFLAGS) ${SOURCE_DIR}/rf_clip.c
@lint $(LINTFLAGS) ${SOURCE_DIR}/fsk2_mod.c
@lint $(LINTFLAGS) ${SOURCE_DIR}/convert.c
@lint $(LINTFLAGS) ${SOURCE_DIR}/conver_lib.c
p:
echo UNAME ${UNAME}
echo OSTYPE ${OSTYPE}
echo CC ${CC}
clean:
@/bin/rm -rf $(OBJECTS_DIR)
realclean:
@/bin/rm -rf $(OBJECTS_DIR)
@/bin/rm -f ./rf_clip ./fsk2_demod ./fsk2_mod