chiark / gitweb /
Build system: Add a formulaic setting of Q from V for debugging
[wiringPi.git] / gpio / Makefile
index b4519fafa7fd8ab9eb7a5e5a0bb22de99b72b25d..df05dbee8f7d2e17b87104cda2e0fbc45aacd717 100644 (file)
@@ -1,9 +1,10 @@
 #
 # Makefile:
-#      wiringPi - Wiring Compatable library for the Raspberry Pi
+#      The gpio command:
+#        A swiss-army knige of GPIO shenanigans.
 #      https://projects.drogon.net/wiring-pi
 #
-#      Copyright (c) 2012 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
-INCLUDE        = -I$(DESTDIR)$(PREFIX)/usr/local/include
+INCLUDE        = -I$(DESTDIR)$(PREFIX)/include
 CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
 
 LDFLAGS        = -L$(DESTDIR)$(PREFIX)/lib
@@ -37,12 +42,15 @@ LIBS    = -lwiringPi -lwiringPiDev -lpthread -lm
 # May not need to  alter anything below this line
 ###############################################################################
 
-SRC    =       gpio.c extensions.c readall.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)
@@ -51,18 +59,18 @@ gpio:       $(OBJ)
        @echo [Compile] $<
        @$(CC) -c $(CFLAGS) $< -o $@
 
-.PHONEY:       clean
+.PHONY:        clean
 clean:
        @echo "[Clean]"
        @rm -f $(OBJ) gpio *~ core tags *.bak
 
-.PHONEY:       tags
+.PHONY:        tags
 tags:  $(SRC)
        @echo [ctags]
        @ctags $(SRC)
 
-.PHONEY:       install
-install:
+.PHONY:        install
+install: gpio
        @echo "[Install]"
        @cp gpio                $(DESTDIR)$(PREFIX)/bin
        @chown root.root        $(DESTDIR)$(PREFIX)/bin/gpio
@@ -70,17 +78,20 @@ install:
        @mkdir -p               $(DESTDIR)$(PREFIX)/man/man1
        @cp gpio.1              $(DESTDIR)$(PREFIX)/man/man1
 
-.PHONEY:       uninstall
+.PHONY:        install-deb
+install-deb:   gpio
+       @echo "[Install: deb]"
+       @install -m 0755 -d                                                     ~/wiringPi/debian/wiringPi/usr/bin
+       @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
 
-.PHONEY:       depend
+.PHONY:        depend
 depend:
        makedepend -Y $(SRC)
 
 # DO NOT DELETE
-
-gpio.o: extensions.h
-extensions.o: extensions.h