summaryrefslogtreecommitdiff
path: root/Makefile
blob: 8ecc85814ee9fdad902a815e204fb86b973e2fca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Makefile for mdns-repeater

HGVERSION=$(shell hg parents --template "{latesttag}.{latesttagdistance}")

CFLAGS=-Wall

ifdef DEBUG
CFLAGS+= -g
else
CFLAGS+= -Os
LDFLAGS+= -s
endif

CFLAGS+= -DHGVERSION="\"${HGVERSION}\""

.PHONY: all clean

all: mdns-repeater

mdns-repeater.o: _hgversion

mdns-repeater: mdns-repeater.o

# version checking rules
.PHONY: dummy
_hgversion: dummy
	@echo $(HGVERSION) | cmp -s $@ - || echo $(HGVERSION) > $@

clean:
	-$(RM) *.o
	-$(RM) _hgversion
	-$(RM) mdns-repeater