3 VERSION = $(shell git describe --always | tail -c +2)
5 CFLAGS += -Wall -g -DNMRPFLASH_VERSION=\"v$(VERSION)\"
8 .PHONY: clean install release release/osx release/linux release/win32
10 nmrpflash: nmrp.o tftp.o ethsock.o main.o arp.o
11 $(CC) $(CFLAGS) -o nmrpflash nmrp.o tftp.o ethsock.o arp.o main.o $(LDFLAGS)
13 nmrp.o: nmrp.c nmrpd.h
14 $(CC) $(CFLAGS) -c -o nmrp.o nmrp.c
16 tftp.o: tftp.c nmrpd.h
17 $(CC) $(CFLAGS) -c -o tftp.o tftp.c
19 ethsock.o: ethsock.c nmrpd.h
20 $(CC) $(CFLAGS) -c -o ethsock.o ethsock.c
23 $(CC) $(CFLAGS) -c -o arp.o arp.c
25 main.o: main.c nmrpd.h
26 $(CC) $(CFLAGS) -c -o main.o main.c
29 rm -f nmrp.o tftp.o main.o ethsock.o arp.o nmrpflash
32 install -m 755 nmrpflash $(PREFIX)/bin
35 CFLAGS="-arch i386 -arch x86_64 -mmacosx-version-min=10.6" make release
36 zip nmrpflash-$(VERSION)-osx.zip nmrpflash
38 release/linux: release
39 zip nmrpflash-$(VERSION)-linux.zip nmrpflash
42 zip nmrpflash-$(VERSION)-win32.zip nmrpflash.exe
44 release: clean nmrpflash