Gordons Projects

--> Projects Top-Level GIT

Bumped the version to 2.40 - correctly this time, I hope.
[wiringPi] / wiringPi / Makefile
index 3a1b99f..0a1283f 100644 (file)
 #################################################################################
 
 VERSION=$(shell cat ../VERSION)
-DESTDIR=/usr
-PREFIX=/local
+DESTDIR?=/usr
+PREFIX?=/local
+
+LDCONFIG?=ldconfig
 
 ifneq ($V,1)
 Q ?= @
@@ -37,9 +39,9 @@ DEBUG = -O2
 CC     = gcc
 INCLUDE        = -I.
 DEFS   = -D_GNU_SOURCE
-CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
+CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Wextra -Winline $(INCLUDE) -pipe -fPIC
 
-LIBS    =
+LIBS    = -lm -lpthread -lrt
 
 ###############################################################################
 
@@ -53,25 +55,14 @@ SRC =       wiringPi.c                                              \
                sr595.c                                                 \
                pcf8574.c pcf8591.c                                     \
                mcp3002.c mcp3004.c mcp4802.c mcp3422.c                 \
-               max31855.c max5322.c                                    \
+               max31855.c max5322.c ads1115.c                          \
                sn3218.c                                                \
-               drcSerial.c                                             \
+               bmp180.c htu21d.c ds18b20.c rht03.c                     \
+               drcSerial.c drcNet.c                                    \
+               pseudoPins.c                                            \
                wpiExtensions.c
 
-HEADERS =      wiringPi.h                                              \
-               wiringSerial.h wiringShift.h                            \
-               wiringPiSPI.h wiringPiI2C.h                             \
-               softPwm.h softTone.h                                    \
-               mcp23008.h mcp23016.h mcp23017.h                        \
-               mcp23s08.h mcp23s17.h                                   \
-               sr595.h                                                 \
-               pcf8574.h pcf8591.h                                     \
-               mcp3002.h mcp3004.h mcp4802.h mcp3422.h                 \
-               max31855.h max5322.h                                    \
-               sn3218.h                                                \
-               drcSerial.h                                             \
-               wpiExtensions.h 
-
+HEADERS =      $(shell ls *.h)
 
 OBJ    =       $(SRC:.c=.o)
 
@@ -87,7 +78,7 @@ $(STATIC):    $(OBJ)
 
 $(DYNAMIC):    $(OBJ)
        $Q echo "[Link (Dynamic)]"
-       $Q $(CC) -shared -Wl,-soname,libwiringPi.so -o libwiringPi.so.$(VERSION) -lpthread $(OBJ)
+       $Q $(CC) -shared -Wl,-soname,libwiringPi.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPi.so.$(VERSION) $(LIBS) $(OBJ)
 
 .c.o:
        $Q echo [Compile] $<
@@ -114,7 +105,7 @@ install:    $(DYNAMIC)
        $Q install -m 0755 -d                                           $(DESTDIR)$(PREFIX)/lib
        $Q install -m 0755 libwiringPi.so.$(VERSION)                    $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION)
        $Q ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION)     $(DESTDIR)/lib/libwiringPi.so
-       $Q ldconfig
+       $Q $(LDCONFIG)
 
 .PHONY:        install-static
 install-static:        $(STATIC)
@@ -140,7 +131,7 @@ uninstall:
        $Q echo "[UnInstall]"
        $Q cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS)
        $Q cd $(DESTDIR)$(PREFIX)/lib/     && rm -f libwiringPi.*
-       $Q ldconfig
+       $Q $(LDCONFIG)
 
 
 .PHONY:        depend
@@ -149,7 +140,7 @@ depend:
 
 # DO NOT DELETE
 
-wiringPi.o: softPwm.h softTone.h wiringPi.h
+wiringPi.o: softPwm.h softTone.h wiringPi.h ../version.h
 wiringSerial.o: wiringSerial.h
 wiringShift.o: wiringPi.h wiringShift.h
 piHiPri.o: wiringPi.h
@@ -172,9 +163,15 @@ mcp4802.o: wiringPi.h wiringPiSPI.h mcp4802.h
 mcp3422.o: wiringPi.h wiringPiI2C.h mcp3422.h
 max31855.o: wiringPi.h wiringPiSPI.h max31855.h
 max5322.o: wiringPi.h wiringPiSPI.h max5322.h
+ads1115.o: wiringPi.h wiringPiI2C.h ads1115.h
 sn3218.o: wiringPi.h wiringPiI2C.h sn3218.h
+bmp180.o: wiringPi.h wiringPiI2C.h bmp180.h
+htu21d.o: wiringPi.h wiringPiI2C.h htu21d.h
+ds18b20.o: wiringPi.h ds18b20.h
 drcSerial.o: wiringPi.h wiringSerial.h drcSerial.h
+pseudoPins.o: wiringPi.h pseudoPins.h
 wpiExtensions.o: wiringPi.h mcp23008.h mcp23016.h mcp23017.h mcp23s08.h
 wpiExtensions.o: mcp23s17.h sr595.h pcf8574.h pcf8591.h mcp3002.h mcp3004.h
-wpiExtensions.o: mcp4802.h mcp3422.h max31855.h max5322.h sn3218.h
-wpiExtensions.o: drcSerial.h wpiExtensions.h
+wpiExtensions.o: mcp4802.h mcp3422.h max31855.h max5322.h ads1115.h sn3218.h
+wpiExtensions.o: drcSerial.h pseudoPins.h bmp180.h htu21d.h ds18b20.h
+wpiExtensions.o: wpiExtensions.h