-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.3 KB
/
Makefile
File metadata and controls
55 lines (41 loc) · 1.3 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
CC=$(CROSS_COMPILE)gcc
EDCFLAGS := -Wall -O2 -I include/ -I drivers/ -pthread -std=gnu11 -Wno-unused-function -Wno-unused-variable $(CFLAGS)
EDLDFLAGS := -lpthread -lm $(LDFLAGS)
COBJS = drivers/gpiodev/gpiodev.o \
drivers/spibus/spibus.o \
src/ringbuf.o \
src/si446x.o
LIBTARGET = libsi446x.a
ifeq ($(INSTALLDIR),)
INSTALLDIR := /usr/local
endif
all: lib basic_test
lib: $(LIBTARGET)
basic_test: basic_test_send.o basic_test_recv.o $(LIBTARGET)
@$(CC) -o test_send.out basic_test_send.o $(LIBTARGET) $(EDLDFLAGS)
@$(CC) -o test_recv.out basic_test_recv.o $(LIBTARGET) $(EDLDFLAGS)
@echo "basic test built"
$(LIBTARGET): $(COBJS)
@ar -crus $(LIBTARGET) $(COBJS)
@echo "$(LIBTARGET) built"
install: $(LIBTARGET)
cp include/si446x.h $(INSTALLDIR)/include/
cp $(LIBTARGET) $(INSTALLDIR)/lib/
@echo "Installed to $(INSTALLDIR)/include and $(INSTALLDIR)/lib"
@echo "Ensure includepath and link path are set correctly for other programs"
@echo "Change of radio configuration will require recompilation and reinstallation of the library"
# remove library only
uninstall:
rm -vf $(INSTALLDIR)/lib/$(LIBTARGET)
%.o: %.c
@$(CC) $(EDCFLAGS) -o $@ -c $<
.PHONY: clean doc spotless
clean:
rm -vf $(LIBTARGET)
rm -vf $(COBJS)
rm -vf *.out
rm -vf *.o
spotless: clean
rm -rf doc
doc:
doxygen .doxyconfig