#
# 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
# 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)
@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
@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