chiark / gitweb /
changed to pin mode to support softPwm.
[wiringPi.git] / gpio / Makefile
1 #
2 # Makefile:
3 #       The gpio command:
4 #         A swiss-army knige of GPIO shenanigans.
5 #       https://projects.drogon.net/wiring-pi
6 #
7 #       Copyright (c) 2012-2013 Gordon Henderson
8 #################################################################################
9 # This file is part of wiringPi:
10 #       Wiring Compatable library for the Raspberry Pi
11 #
12 #    wiringPi is free software: you can redistribute it and/or modify
13 #    it under the terms of the GNU Lesser General Public License as published by
14 #    the Free Software Foundation, either version 3 of the License, or
15 #    (at your option) any later version.
16 #
17 #    wiringPi is distributed in the hope that it will be useful,
18 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
19 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 #    GNU Lesser General Public License for more details.
21 #
22 #    You should have received a copy of the GNU Lesser General Public License
23 #    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
24 #################################################################################
25
26 DESTDIR=/usr
27 PREFIX=/local
28
29 #DEBUG  = -g -O0
30 DEBUG   = -O2
31 CC      = gcc
32 INCLUDE = -I$(DESTDIR)$(PREFIX)/include
33 CFLAGS  = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
34
35 LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib
36 LIBS    = -lwiringPi -lwiringPiDev -lpthread -lm
37
38 # May not need to  alter anything below this line
39 ###############################################################################
40
41 SRC     =       gpio.c extensions.c readall.c pins.c
42
43 OBJ     =       $(SRC:.c=.o)
44
45 all:            gpio
46
47 gpio:   $(OBJ)
48         @echo [Link]
49         @$(CC) -o $@ $(OBJ) $(LDFLAGS) $(LIBS)
50         
51 .c.o:
52         @echo [Compile] $<
53         @$(CC) -c $(CFLAGS) $< -o $@
54
55 .PHONY: clean
56 clean:
57         @echo "[Clean]"
58         @rm -f $(OBJ) gpio *~ core tags *.bak
59
60 .PHONY: tags
61 tags:   $(SRC)
62         @echo [ctags]
63         @ctags $(SRC)
64
65 .PHONY: install
66 install:
67         @echo "[Install]"
68         @cp gpio                $(DESTDIR)$(PREFIX)/bin
69         @chown root.root        $(DESTDIR)$(PREFIX)/bin/gpio
70         @chmod 4755             $(DESTDIR)$(PREFIX)/bin/gpio
71         @mkdir -p               $(DESTDIR)$(PREFIX)/man/man1
72         @cp gpio.1              $(DESTDIR)$(PREFIX)/man/man1
73
74 .PHONY: uninstall
75 uninstall:
76         @echo "[UnInstall]"
77         @rm -f $(DESTDIR)$(PREFIX)/bin/gpio
78         @rm -f $(DESTDIR)$(PREFIX)/man/man1/gpio.1
79
80 .PHONY: depend
81 depend:
82         makedepend -Y $(SRC)
83
84 # DO NOT DELETE
85
86 gpio.o: extensions.h
87 extensions.o: extensions.h