Guest User

makefile for gpio

a guest
Oct 21st, 2012
239
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #DEBUG = -g -O0
  2. DEBUG = -O3
  3. CC = gcc
  4. INCLUDE = -I/usr/local/include -I../wiringPi
  5. CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
  6.  
  7. LDFLAGS = -L/usr/local/lib -L../wiringPi
  8. LIBS = -lwiringPi
  9.  
  10. # Should not alter anything below this line
  11. ###############################################################################
  12.  
  13. SRC = gpio.c
  14.  
  15. OBJ = gpio.o
  16.  
  17. all: gpio
  18.  
  19. gpio: gpio.o /usr/local/lib/libwiringPi.a
  20. @echo [LD]
  21. @$(CC) -o $@ gpio.o $(LDFLAGS) $(LIBS)
  22.  
  23. .c.o:
  24. @echo [CC] $<
  25. @$(CC) -c $(CFLAGS) $< -o $@
  26.  
  27. clean:
  28. rm -f $(OBJ) gpio *~ core tags
  29.  
  30. tags: $(SRC)
  31. @echo [ctags]
  32. @ctags $(SRC)
  33.  
  34. depend:
  35. makedepend -Y $(SRC)
  36.  
  37. install:
  38. cp gpio /usr/local/bin
  39. chown root.root /usr/local/bin/gpio
  40. chmod 4755 /usr/local/bin/gpio
  41. mkdir -p /usr/local/man/man1
  42. cp gpio.1 /usr/local/man/man1
  43.  
  44. uninstall:
  45. rm -f /usr/local/bin/gpio
  46. rm -f /usr/local/man/man1/gpio.1
  47.  
  48. # DO NOT DELETE
RAW Paste Data