zeroconf/Makefile

62 lines
1.2 KiB
Makefile

#
# Makefile for tinysvcmdns
#
CPPFLAGS += -DPTHREAD_CREATE_DETACHED_SUPPORTED
#CPPFLAGS += -DNDEBUG
CPPFLAGS += $(CPPFLAGS_EXTRA)
CFLAGS += -Wall -pedantic -std=gnu99
CFLAGS += -g
CFLAGS += -O2
CFLAGS += $(CFLAGS_EXTRA)
LDLIBS = -lpthread
ifneq ($(CROSS_COMPILE),)
CC = gcc
CC := $(CROSS_COMPILE)$(CC)
AR := $(CROSS_COMPILE)$(AR)
endif
BIN=testmdnsd mdnsd
LIBTINYSVCMDNS_OBJS = mdns.o mdnsd.o
.PHONY: all clean opkg release opkg-service opkg-init
all: $(BIN) libtinysvcmdns.a
clean:
-$(RM) $(LIBTINYSVCMDNS_OBJS)
-$(RM) $(BIN)
-$(RM) libtinysvcmdns.a
mdns.o: mdns.h
mdnsd.o: mdns.h mdnsd.h
testmdnsd.o: mdnsd.h
testmdnsd: testmdnsd.o libtinysvcmdns.a
libtinysvcmdns.a: $(patsubst %, libtinysvcmdns.a(%), $(LIBTINYSVCMDNS_OBJS))
mdnsd: testmdnsd
strip -o $@ $<
opkg-init: $(wildcard etc/init.d/*)
install -D -p $< opkg/etc/init.d/
opkg-service: $(wildcard etc/modservice.d/*)
install -m 644 -D -p $< opkg/etc/modservice.d
opkg: mdnsd $(wildcard opkg/CONTROL/*) opkg-init opkg-service
install -D -p mdnsd opkg/sbin
opkg-pack opkg
release: opkg
tagname=$$(echo zeroconf*.opk | sed -n 'p;q') && \
tagname="$${tagname%_*.*}" && \
test -n "$${tagname}" && \
git tag -f -a -m "Release $${tagname}" "$${tagname}"