chiark / gitweb /
Build system: Remove a trailing tab from gpio/Makefile
[wiringPi.git] / gpio / Makefile
index b4519fafa7fd8ab9eb7a5e5a0bb22de99b72b25d..82416a720b7114a0d6d305789999c0dac50319dc 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,50 +42,56 @@ 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)
-       
+       $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 $@
 
-.PHONEY:       clean
+.PHONY:        clean
 clean:
-       @echo "[Clean]"
-       @rm -f $(OBJ) gpio *~ core tags *.bak
+       $Q echo "[Clean]"
+       $Q rm -f $(OBJ) gpio *~ core tags *.bak
 
-.PHONEY:       tags
+.PHONY:        tags
 tags:  $(SRC)
-       @echo [ctags]
-       @ctags $(SRC)
-
-.PHONEY:       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
-
-.PHONEY:       uninstall
+       $Q echo [ctags]
+       $Q ctags $(SRC)
+
+.PHONY:        install
+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
 
-.PHONEY:       depend
+.PHONY:        depend
 depend:
        makedepend -Y $(SRC)
 
 # DO NOT DELETE
-
-gpio.o: extensions.h
-extensions.o: extensions.h