chiark / gitweb /
Build system: Enable V=1 to disable @'s
[wiringPi.git] / gpio / Makefile
index 37b4887dcba284e13cc8ececca945e0a076d709d..09a9cc96cdf6acfa3b5c7477f9abca21c9a46702 100644 (file)
@@ -4,7 +4,7 @@
 #        A swiss-army knige of GPIO shenanigans.
 #      https://projects.drogon.net/wiring-pi
 #
-#      Copyright (c) 2012-2013 Gordon Henderson
+#      Copyright (c) 2012-2015 Gordon Henderson
 #################################################################################
 # This file is part of wiringPi:
 #      Wiring Compatable library for the Raspberry Pi
 DESTDIR=/usr
 PREFIX=/local
 
+ifneq ($V,1)
+Q ?= @
+endif
+
 #DEBUG = -g -O0
 DEBUG  = -O2
 CC     = gcc
@@ -38,50 +42,56 @@ LIBS    = -lwiringPi -lwiringPiDev -lpthread -lm
 # May not need to  alter anything below this line
 ###############################################################################
 
-SRC    =       gpio.c extensions.c readall.c pins.c
+SRC    =       gpio.c readall.c pins.c
 
 OBJ    =       $(SRC:.c=.o)
 
 all:           gpio
 
+version.h:     ../VERSION
+       ./newVersion
+
 gpio:  $(OBJ)
-       @echo [Link]
-       @$(CC) -o $@ $(OBJ) $(LDFLAGS) $(LIBS)
+       $Q echo [Link]
+       $Q $(CC) -o $@ $(OBJ) $(LDFLAGS) $(LIBS)
        
 .c.o:
-       @echo [Compile] $<
-       @$(CC) -c $(CFLAGS) $< -o $@
+       $Q echo [Compile] $<
+       $Q $(CC) -c $(CFLAGS) $< -o $@
 
 .PHONY:        clean
 clean:
-       @echo "[Clean]"
-       @rm -f $(OBJ) gpio *~ core tags *.bak
+       $Q echo "[Clean]"
+       $Q rm -f $(OBJ) gpio *~ core tags *.bak
 
 .PHONY:        tags
 tags:  $(SRC)
-       @echo [ctags]
-       @ctags $(SRC)
+       $Q echo [ctags]
+       $Q ctags $(SRC)
 
 .PHONY:        install
-install:
-       @echo "[Install]"
-       @cp gpio                $(DESTDIR)$(PREFIX)/bin
-       @chown root.root        $(DESTDIR)$(PREFIX)/bin/gpio
-       @chmod 4755             $(DESTDIR)$(PREFIX)/bin/gpio
-       @mkdir -p               $(DESTDIR)$(PREFIX)/man/man1
-       @cp gpio.1              $(DESTDIR)$(PREFIX)/man/man1
+install: gpio
+       $Q echo "[Install]"
+       $Q cp gpio              $(DESTDIR)$(PREFIX)/bin
+       $Q chown root.root      $(DESTDIR)$(PREFIX)/bin/gpio
+       $Q chmod 4755           $(DESTDIR)$(PREFIX)/bin/gpio
+       $Q mkdir -p             $(DESTDIR)$(PREFIX)/man/man1
+       $Q cp gpio.1            $(DESTDIR)$(PREFIX)/man/man1
+
+.PHONY:        install-deb
+install-deb:   gpio
+       $Q echo "[Install: deb]"
+       $Q install -m 0755 -d                                                   ~/wiringPi/debian/wiringPi/usr/bin
+       $Q install -m 0755 gpio                                                 ~/wiringPi/debian/wiringPi/usr/bin
 
 .PHONY:        uninstall
 uninstall:
-       @echo "[UnInstall]"
-       @rm -f $(DESTDIR)$(PREFIX)/bin/gpio
-       @rm -f $(DESTDIR)$(PREFIX)/man/man1/gpio.1
+       $Q echo "[UnInstall]"
+       $Q rm -f $(DESTDIR)$(PREFIX)/bin/gpio
+       $Q rm -f $(DESTDIR)$(PREFIX)/man/man1/gpio.1
 
 .PHONY:        depend
 depend:
        makedepend -Y $(SRC)
 
 # DO NOT DELETE
-
-gpio.o: extensions.h
-extensions.o: extensions.h