54 lines
947 B
Makefile
54 lines
947 B
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
|
|
|
|
LIBTINYSVCMDNS_OBJS = mdns.o mdnsd.o
|
|
|
|
.PHONY: all clean opkg
|
|
|
|
all: $(BIN) libtinysvcmdns.a
|
|
|
|
clean:
|
|
-$(RM) *.o
|
|
-$(RM) *.bin
|
|
-$(RM) mdns
|
|
-$(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 $@ $<
|
|
install -C -D -p mdnsd sbin/
|
|
|
|
opkg: mdnsd $(wildcard opkg/CONTROL/*) etc/init.d/S80mdnsd
|
|
install -D -p mdnsd opkg/sbin
|
|
install -D -p etc/init.d/S80mdnsd opkg/etc/init.d/
|
|
opkg-pack opkg
|
|
|