-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
46 lines (35 loc) · 793 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
CC ?= cc
CFLAGS =-g -Wall -Ideps -Wextra
SOURCES = src/bbgpio.c
OBJECTS = $(SOURCES:.c=.o)
DEBUGGER=lldb
SYNCTOOL=rsync
SYNCFLAGS = -rav * [email protected]
BBBFOLDER =/home/debian/gpio_lib/
PREFIX ?= /usr/local
LINUXPREFIX ?= /usr
all:build/bbgpio.o
install: all
ln -f build/bbgpio.o $(LINUXPREFIX)/lib/bbgpio.o
ln -f src/bbgpio.h $(LINUXPREFIX)/include/bbgpio.h
uninstall:
rm -f $(LINUXPREFIX)/lib/bbgpio.o
rm -f $(LINUXPREFIX)/include/bbgpio.h
build/bbgpio.o: $(OBJECTS)
@mkdir -p build
cp $^ $@
bin/test: test.o $(OBJECTS)
@mkdir -p bin
$(CC) $^ -o $@
%.o: %.c
$(CC) $< $(CFLAGS) -c -o $@
clean:
rm -fr bin build *.o src/*.o
test: bin/test
echo @./$<
@./$<
debug: bin/test
$(DEBUGGER) $<
deploy:all
$(SYNCTOOL) $(SYNCFLAGS):$(BBBFOLDER)
.PHONY: test clean deploy