-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (31 loc) · 801 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
PACKAGES := libconfig
PACKAGES_CFLAGS := $(shell pkg-config --cflags $(PACKAGES))
PACKAGES_LIBS := $(shell pkg-config --libs $(PACKAGES))
ecd: ecd.o
gcc -o ecd ecd.o -lbcm2835 -lwiringPi -lm -Wall $(PACKAGES_LIBS)
@echo "Building complite...\n"
ecd.o: ecd.c
gcc $(PACKAGES_CFLAGS) -c -o ecd.o ecd.c
install:
make ecd
@echo "Building complite...\n"
@killall ecd
@cp ecd /usr/bin/
@cp conf/ecd.conf /etc/
@echo "Create init.d scripts..."
@cp conf/ecd /etc/init.d/
@chmod +x /etc/init.d/ecd
@update-rc.d ecd defaults
@service ecd start
reinstall:
make ecd
echo "Building complite...\n"
service ecd stop
cp ecd /usr/bin/
service ecd start
config:
cp conf/ecd.conf /etc/
echo "Create init.d scripts..."
cp conf/ecd /etc/init.d/
chmod +x /etc/init.d/ecd
update-rc.d ecd defaults