2
0

Makefile 960 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. CC ?= gcc
  2. PREFIX ?= /usr/local
  3. VERSION = $(shell git describe --always)
  4. CFLAGS += -Wall -g -DNMRPFLASH_VERSION=\"$(VERSION)\"
  5. LIBS = -lpcap
  6. .PHONY: clean install release release/osx release/linux release/win32
  7. nmrpflash: nmrp.o tftp.o ethsock.o main.o
  8. $(CC) $(CFLAGS) -o nmrpflash nmrp.o tftp.o ethsock.o main.o $(LIBS)
  9. nmrp.o: nmrp.c nmrpd.h
  10. $(CC) $(CFLAGS) -c -o nmrp.o nmrp.c
  11. tftp.o: tftp.c nmrpd.h
  12. $(CC) $(CFLAGS) -c -o tftp.o tftp.c
  13. ethsock.o: ethsock.c nmrpd.h
  14. $(CC) $(CFLAGS) -c -o ethsock.o ethsock.c
  15. main.o: main.c nmrpd.h
  16. $(CC) $(CFLAGS) -c -o main.o main.c
  17. clean:
  18. rm -f nmrp.o tftp.o main.o ethsock.o nmrpflash nmrpflash.exe
  19. install: nmrpflash
  20. install -m 755 nmrpflash $(PREFIX)/bin
  21. release/osx:
  22. CFLAGS="-arch i686 -arch x86_64" make release
  23. zip nmrpflash-osx.zip nmrpflash
  24. release/linux: release
  25. zip nmrpflash-linux.zip nmrpflash
  26. release/win32:
  27. zip nmrpflash-win32.zip nmrpflash.exe
  28. release: clean nmrpflash
  29. strip nmrpflash