Statistics
| Branch: | Revision:

ddr4s / fw / wiringPi / wiringPiD / Makefile @ 32:cadb9025f1e0

History | View | Annotate | Download (2.77 KB)

1
#
2
# Makefile:
3
#	The wiringPiD utility:
4
#	https://projects.drogon.net/wiring-pi
5
#
6
#	Copyright (c) 2012-2017 Gordon Henderson
7
#################################################################################
8
# This file is part of wiringPi:
9
#	A "wiring" library for the Raspberry Pi
10
#
11
#    wiringPi is free software: you can redistribute it and/or modify
12
#    it under the terms of the GNU Lesser General Public License as published by
13
#    the Free Software Foundation, either version 3 of the License, or
14
#    (at your option) any later version.
15
#
16
#    wiringPi is distributed in the hope that it will be useful,
17
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
18
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
#    GNU Lesser General Public License for more details.
20
#
21
#    You should have received a copy of the GNU Lesser General Public License
22
#    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
23
#################################################################################
24

    
25
DESTDIR?=/usr
26
PREFIX?=/local
27

    
28
ifneq ($V,1)
29
Q ?= @
30
endif
31

    
32
#DEBUG	= -g -O0
33
DEBUG	= -O2
34
INCLUDE	= -I$(DESTDIR)$(PREFIX)/include
35
CFLAGS	= $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe
36

    
37
LDFLAGS	= -L$(DESTDIR)$(PREFIX)/lib
38
LIBS    = -lwiringPi -lwiringPiDev -lpthread -lrt -lm -lcrypt
39

    
40
# May not need to  alter anything below this line
41
###############################################################################
42

    
43
SRC	=	wiringpid.c network.c runRemote.c daemonise.c
44

    
45
OBJ	=	$(SRC:.c=.o)
46

    
47
all:		wiringpid
48

    
49
wiringpid:	$(OBJ)
50
	$Q echo [Link]
51
	$Q $(CC) -o $@ $(OBJ) $(LDFLAGS) $(LIBS)
52

    
53
.c.o:
54
	$Q echo [Compile] $<
55
	$Q $(CC) -c $(CFLAGS) $< -o $@
56

    
57
.PHONY:	clean
58
clean:
59
	$Q echo "[Clean]"
60
	$Q rm -f $(OBJ) wiringpid *~ core tags *.bak
61

    
62
.PHONY:	tags
63
tags:	$(SRC)
64
	$Q echo [ctags]
65
	$Q ctags $(SRC)
66

    
67
.PHONY:	install
68
install: wiringpid
69
	$Q echo "[Install]"
70
	$Q mkdir -p		$(DESTDIR)$(PREFIX)/sbin
71
	$Q cp wiringpid		$(DESTDIR)$(PREFIX)/sbin
72
	$Q chown root.root	$(DESTDIR)$(PREFIX)/sbin/wiringpid
73

    
74
#	$Q mkdir -p		$(DESTDIR)$(PREFIX)/man/man8
75
#	$Q cp gpio.1		$(DESTDIR)$(PREFIX)/man/man8
76

    
77
.PHONY:	install-deb
78
install-deb:	gpio
79
	$Q echo "[Install: deb]"
80
	$Q install -m 0755 -d							~/wiringPi/debian-template/wiringPi/usr/bin
81
	$Q install -m 0755 gpio							~/wiringPi/debian-template/wiringPi/usr/bin
82
	$Q install -m 0755 -d							~/wiringPi/debian-template/wiringPi/man/man1
83
	$Q install -m 0644 gpio.1						~/wiringPi/debian-template/wiringPi/man/man1
84

    
85
.PHONY:	uninstall
86
uninstall:
87
	$Q echo "[UnInstall]"
88
	$Q rm -f $(DESTDIR)$(PREFIX)/sbin/wiringpid
89
	$Q rm -f $(DESTDIR)$(PREFIX)/man/man8/wiringpid.8
90

    
91
.PHONY:	depend
92
depend:
93
	makedepend -Y $(SRC)
94
# DO NOT DELETE
95

    
96
wiringpid.o: drcNetCmd.h network.h runRemote.h daemonise.h
97
network.o: network.h
98
runRemote.o: drcNetCmd.h network.h runRemote.h
99
daemonise.o: daemonise.h