-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
48 lines (37 loc) · 969 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
47
48
DESTDIR?=/usr
PREFIX?=/local
ifneq ($V,1)
Q ?= @
endif
CC = gcc
CFLAGS = $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe
LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib
LIBS = -lpthread -lrt -lm -lcrypt
SRC = src/relay.c src/comm.c src/thread.c
OBJ = $(SRC:.c=.o)
all: 16relind
16relind: $(OBJ)
$Q echo [Link]
$Q $(CC) -o $@ $(OBJ) $(LDFLAGS) $(LIBS)
.c.o:
$Q echo [Compile] $<
$Q $(CC) -c $(CFLAGS) $< -o $@
.PHONY: clean
clean:
$Q echo "[Clean]"
$Q rm -f $(OBJ) 16relind *~ core tags *.bak
.PHONY: install
install: 16relind
$Q echo "[Install]"
$Q cp 16relind $(DESTDIR)$(PREFIX)/bin
ifneq ($(WIRINGPI_SUID),0)
$Q chown root:root $(DESTDIR)$(PREFIX)/bin/16relind
$Q chmod 4755 $(DESTDIR)$(PREFIX)/bin/16relind
endif
# $Q mkdir -p $(DESTDIR)$(PREFIX)/man/man1
# $Q cp megaio.1 $(DESTDIR)$(PREFIX)/man/man1
.PHONY: uninstall
uninstall:
$Q echo "[UnInstall]"
$Q rm -f $(DESTDIR)$(PREFIX)/bin/16relind
$Q rm -f $(DESTDIR)$(PREFIX)/man/man1/16relind.1