chiark / gitweb /
Fixed delayMicroseconds for more than 1 second.
[wiringPi.git] / gpio / Makefile
index a92dd5f930150d70ac36f22a183f99bb4ca8ddee..883bfc25da918eacd099955031cc5193677deca2 100644 (file)
 
 
 #DEBUG = -g -O0
-DEBUG  = -O3
+DEBUG  = -O2
 CC     = gcc
 INCLUDE        = -I/usr/local/include
 CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
 
 LDFLAGS        = -L/usr/local/lib
-LIBS    = -lwiringPi
+LIBS    = -lwiringPi -lwiringPiDev -lpthread -lm
 
-# Should not alter anything below this line
+# May not need to  alter anything below this line
 ###############################################################################
 
-SRC    =       gpio.c
+SRC    =       gpio.c extensions.c readall.c
 
-OBJ    =       gpio.o
+OBJ    =       $(SRC:.c=.o)
 
 all:           gpio
 
-gpio:  gpio.o /usr/local/lib/libwiringPi.a
-       @echo [LD]
-       @$(CC) -o $@ gpio.o $(LDFLAGS) $(LIBS)
+gpio:  $(OBJ)
+       @echo [Link]
+       @$(CC) -o $@ $(OBJ) $(LDFLAGS) $(LIBS)
        
 .c.o:
-       @echo [CC] $<
+       @echo [Compile] $<
        @$(CC) -c $(CFLAGS) $< -o $@
 
+.PHONEY:       clean
 clean:
-       rm -f $(OBJ) gpio *~ core tags
+       @echo "[Clean]"
+       @rm -f $(OBJ) gpio *~ core tags *.bak
 
+.PHONEY:       tags
 tags:  $(SRC)
        @echo [ctags]
        @ctags $(SRC)
 
-depend:
-       makedepend -Y $(SRC)
-
+.PHONEY:       install
 install:
-       cp gpio /usr/local/bin
-       chown root.root /usr/local/bin/gpio
-       chmod 4755 /usr/local/bin/gpio
-       mkdir -p /usr/local/man/man1
-       cp gpio.1 /usr/local/man/man1
+       @echo "[Install]"
+       @cp gpio /usr/local/bin
+       @chown root.root /usr/local/bin/gpio
+       @chmod 4755 /usr/local/bin/gpio
+       @mkdir -p /usr/local/man/man1
+       @cp gpio.1 /usr/local/man/man1
 
+.PHONEY:       uninstall
 uninstall:
-       rm -f /usr/local/bin/gpio
-       rm -f /usr/local/man/man1/gpio.1
+       @echo "[UnInstall]"
+       @rm -f /usr/local/bin/gpio
+       @rm -f /usr/local/man/man1/gpio.1
+
+.PHONEY:       depend
+depend:
+       makedepend -Y $(SRC)
 
 # DO NOT DELETE
+
+gpio.o: extensions.h
+extensions.o: extensions.h