Remove unused msg_dump arg
[oweals/nmrpflash.git] / Makefile
1 CC ?= gcc
2 PREFIX ?= /usr/local
3 VERSION = $(shell git describe --always | tail -c +2)
4 LIBS = -lpcap
5 CFLAGS += -Wall -g -DNMRPFLASH_VERSION=\"$(VERSION)\"
6 LDFLAGS += $(LIBS)
7
8 nmrpflash_OBJ = nmrp.o tftp.o ethsock.o main.o util.o
9
10 .PHONY: clean install release release/osx release/linux release/win32
11
12 nmrpflash: $(nmrpflash_OBJ)
13         $(CC) $(CFLAGS) -o nmrpflash $(nmrpflash_OBJ) $(LDFLAGS)
14
15 %.o: %.c nmrpd.h
16         $(CC) -c $(CFLAGS) $< -o $@
17
18 fuzz: clean
19         CC=afl-gcc CFLAGS=-DNMRPFLASH_FUZZ make nmrpflash
20         mv nmrpflash fuzz
21
22 clean:
23         rm -f nmrp.o tftp.o main.o ethsock.o nmrpflash
24
25 install: nmrpflash
26         install -m 755 nmrpflash $(PREFIX)/bin
27
28 release/osx:
29         CFLAGS="-arch i386 -arch x86_64 -mmacosx-version-min=10.6" make release
30         zip nmrpflash-$(VERSION)-osx.zip nmrpflash
31
32 release/linux: release
33         zip nmrpflash-$(VERSION)-linux.zip nmrpflash
34
35 release/win32:
36         zip nmrpflash-$(VERSION)-win32.zip nmrpflash.exe
37
38 release: clean nmrpflash
39         strip nmrpflash