2011-04-10 13:51:52 +00:00
|
|
|
#
|
|
|
|
# Makefile for tinysvcmdns
|
|
|
|
#
|
2020-10-16 14:32:18 +00:00
|
|
|
|
|
|
|
MV ?= mv
|
|
|
|
|
2020-07-24 09:16:53 +00:00
|
|
|
CPPFLAGS += -DPTHREAD_CREATE_DETACHED_SUPPORTED
|
|
|
|
#CPPFLAGS += -DNDEBUG
|
|
|
|
CPPFLAGS += $(CPPFLAGS_EXTRA)
|
2011-04-10 13:51:52 +00:00
|
|
|
|
|
|
|
CFLAGS += -Wall -pedantic -std=gnu99
|
2020-07-23 10:22:32 +00:00
|
|
|
CFLAGS += -g
|
|
|
|
CFLAGS += -O2
|
2020-07-24 09:16:53 +00:00
|
|
|
CFLAGS += $(CFLAGS_EXTRA)
|
2011-04-10 13:51:52 +00:00
|
|
|
LDLIBS = -lpthread
|
|
|
|
|
2012-12-11 15:39:24 +00:00
|
|
|
ifneq ($(CROSS_COMPILE),)
|
|
|
|
CC = gcc
|
|
|
|
CC := $(CROSS_COMPILE)$(CC)
|
|
|
|
AR := $(CROSS_COMPILE)$(AR)
|
|
|
|
endif
|
|
|
|
|
2020-07-28 15:42:57 +00:00
|
|
|
BIN=testmdnsd mdnsd
|
2011-04-10 13:51:52 +00:00
|
|
|
|
|
|
|
LIBTINYSVCMDNS_OBJS = mdns.o mdnsd.o
|
|
|
|
|
2020-08-02 19:36:10 +00:00
|
|
|
.PHONY: all clean opkg release opkg-service opkg-init
|
2011-04-10 13:51:52 +00:00
|
|
|
|
|
|
|
all: $(BIN) libtinysvcmdns.a
|
|
|
|
|
|
|
|
clean:
|
2020-07-28 15:42:57 +00:00
|
|
|
-$(RM) $(LIBTINYSVCMDNS_OBJS)
|
2011-04-10 13:51:52 +00:00
|
|
|
-$(RM) $(BIN)
|
|
|
|
-$(RM) libtinysvcmdns.a
|
|
|
|
|
2020-07-23 10:22:32 +00:00
|
|
|
mdns.o: mdns.h
|
2011-04-10 13:51:52 +00:00
|
|
|
|
2020-07-23 10:22:32 +00:00
|
|
|
mdnsd.o: mdns.h mdnsd.h
|
|
|
|
|
|
|
|
testmdnsd.o: mdnsd.h
|
2011-04-10 13:51:52 +00:00
|
|
|
|
|
|
|
testmdnsd: testmdnsd.o libtinysvcmdns.a
|
|
|
|
|
|
|
|
libtinysvcmdns.a: $(patsubst %, libtinysvcmdns.a(%), $(LIBTINYSVCMDNS_OBJS))
|
|
|
|
|
2020-07-23 10:22:32 +00:00
|
|
|
mdnsd: testmdnsd
|
|
|
|
strip -o $@ $<
|
|
|
|
|
2020-08-02 19:36:10 +00:00
|
|
|
opkg-init: $(wildcard etc/init.d/*)
|
2020-10-16 14:11:49 +00:00
|
|
|
install -d opkg/etc/init.d
|
|
|
|
install -p $? opkg/etc/init.d/
|
2020-08-02 19:36:10 +00:00
|
|
|
|
|
|
|
opkg-service: $(wildcard etc/modservice.d/*)
|
2020-10-16 14:11:49 +00:00
|
|
|
install -d opkg/etc/modservice.d
|
|
|
|
install -m 644 -p $? opkg/etc/modservice.d/
|
2020-08-02 19:36:10 +00:00
|
|
|
|
|
|
|
opkg: mdnsd $(wildcard opkg/CONTROL/*) opkg-init opkg-service
|
2020-10-16 14:11:49 +00:00
|
|
|
install -d opkg/sbin
|
|
|
|
install -p $< opkg/sbin/
|
2020-10-16 14:32:18 +00:00
|
|
|
$(foreach opk,$(wildcard *.opk),$(MV) $(opk) $(opk).old; )
|
2020-07-27 23:28:33 +00:00
|
|
|
opkg-pack opkg
|
2020-07-28 15:42:57 +00:00
|
|
|
|
|
|
|
release: opkg
|
|
|
|
tagname=$$(echo zeroconf*.opk | sed -n 'p;q') && \
|
|
|
|
tagname="$${tagname%_*.*}" && \
|
|
|
|
test -n "$${tagname}" && \
|
|
|
|
git tag -f -a -m "Release $${tagname}" "$${tagname}"
|
2020-07-27 23:28:33 +00:00
|
|
|
|