blob: 2d166fafb05b909391083c982bebc36edc4f163e (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# Makefile for mdns-repeater
ZIP_NAME = mdns-repeater-$(VCSVERSION)
ZIP_FILES = mdns-repeater \
README.txt \
LICENSE.txt
VCSVERSION=$(shell git describe --dirty="-SNAPSHOT" --always --tags)
CFLAGS=-Wall
ifdef DEBUG
CFLAGS+= -g
else
CFLAGS+= -Os
LDFLAGS+= -s
endif
CFLAGS+= -DVCSVERSION="\"${VCSVERSION}\""
.PHONY: all clean
all: mdns-repeater
mdns-repeater.o: _version
mdns-repeater: mdns-repeater.o
.PHONY: zip
zip: TMPDIR := $(shell mktemp -d)
zip: mdns-repeater
mkdir $(TMPDIR)/$(ZIP_NAME)
cp $(ZIP_FILES) $(TMPDIR)/$(ZIP_NAME)
-$(RM) $(CURDIR)/$(ZIP_NAME).zip
cd $(TMPDIR) && zip -r $(CURDIR)/$(ZIP_NAME).zip $(ZIP_NAME)
-$(RM) -rf $(TMPDIR)
# version checking rules
.PHONY: dummy
_version: dummy
@echo $(VCSVERSION) | cmp -s $@ - || echo $(VCSVERSION) > $@
clean:
-$(RM) *.o
-$(RM) _version
-$(RM) mdns-repeater
-$(RM) mdns-repeater-*.zip
-$(RM) build-stamp
-$(RM) -rf debian/mdns-repeater
install:
install -d $(DESTDIR)/usr/sbin
install -m 0755 mdns-repeater $(DESTDIR)/usr/sbin
|