Home | History | Annotate | Line # | Download | only in ServiceRegistration
      1  1.1  christos BUILDDIR = build
      2  1.1  christos OBJDIR = objects
      3  1.1  christos GENKEY=\"/usr/local/bin/mbedtls_gen_key\"
      4  1.1  christos CERTWRITE=\"/usr/local/bin/mbedtls_cert_write\"
      5  1.1  christos 
      6  1.1  christos ifndef os
      7  1.1  christos   SYSTEM := $(shell uname -s)
      8  1.1  christos   ifeq ($(SYSTEM), Darwin)
      9  1.1  christos     os=x
     10  1.1  christos   else ifeq ($(SYSTEM), Linux)
     11  1.1  christos     os_id := $(shell sed -n -e 's/^ID=//p' < /etc/os-release)
     12  1.1  christos     ifeq ($(os_id), raspbian)
     13  1.1  christos       os=raspbian
     14  1.1  christos     else
     15  1.1  christos       os=linux
     16  1.1  christos     endif
     17  1.1  christos   endif
     18  1.1  christos endif
     19  1.1  christos 
     20  1.1  christos ifdef INSTBASE
     21  1.1  christos   INSTALL_PREFIX=$(INSTBASE)
     22  1.1  christos else
     23  1.1  christos   INSTALL_PREFIX=$(DESTDIR)/usr
     24  1.1  christos endif
     25  1.1  christos 
     26  1.1  christos INSTALL?=install
     27  1.1  christos 
     28  1.1  christos INCLUDEDIRS=-I../mDNSShared -I../mDNSMacOSX/xpc_services -I../DSO -I../mDNSCore -I../mDNSShared/utilities
     29  1.1  christos ifeq ($(os),x)
     30  1.1  christos SRPCFLAGS = -O0 -g -Wall -Werror -I../mDNSCore -I/usr/local/include -I. -I../mDNSMacOSX/Private $(INCLUDEDIRS) -I../DSO -MMD -MF .depfile-${notdir $@} -DUSE_KQUEUE -DHAVE_SOCKADDR_DL -DGENKEY_PROGRAM=$(GENKEY) -DCERTWRITE_PROGRAM=$(CERTWRITE) -DEXCLUDE_TLS -DPOSIX_BUILD -D__APPLE_USE_RFC_3542 -DSTANDALONE
     31  1.1  christos SRPLDOPTS = -framework CoreServices -framework Security -framework CoreFoundation -framework Network
     32  1.1  christos HMACOBJS     = $(OBJDIR)/hmac-macos.o
     33  1.1  christos SIGNOBJS     = $(OBJDIR)/sign-macos.o $(OBJDIR)/srp-filedata.o
     34  1.1  christos VERIFYOBJS   = $(OBJDIR)/verify-macos.o
     35  1.1  christos TLSOBJS      = $(OBJDIR)/tls-macos.o
     36  1.1  christos IOOBJS       = $(OBJDIR)/ioloop.o $(OBJDIR)/posix.o $(OBJDIR)/ioloop-common.o
     37  1.1  christos IOWOTLSOBJS  = $(OBJDIR)/ioloop.o $(OBJDIR)/posix.o
     38  1.1  christos else ifeq ($(os), linux)
     39  1.1  christos SRPCFLAGS = -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" -O0 -g -Wall -Werror -DSTANDALONE -I../mDNSCore -I/usr/local/include -I. -I../mDNSMacOSX/Private $(INCLUDEDIRS) -I../DSO -MMD -MF .depfile-${notdir $@} -DNOT_HAVE_SA_LEN -DUSE_SELECT -DUSE_INOTIFY -DGENKEY_PROGRAM=$(GENKEY) -DCERTWRITE_PROGRAM=$(CERTWRITE) -DLINUX -DSRP_CRYPTO_MBEDTLS -DPOSIX_BUILD -DMDNS_NO_STRICT
     40  1.1  christos #SRPLDOPTS = /usr/local/lib/libmbedtls.a /usr/local/lib/libmbedx509.a /usr/local/lib/libmbedcrypto.a -lbsd
     41  1.1  christos SRPLDOPTS = -lmbedcrypto -lmbedtls -lmbedx509
     42  1.1  christos HMACOBJS     = $(OBJDIR)/hmac-mbedtls.o
     43  1.1  christos SIGNOBJS     = $(OBJDIR)/sign-mbedtls.o $(OBJDIR)/srp-filedata.o
     44  1.1  christos VERIFYOBJS   = $(OBJDIR)/verify-mbedtls.o
     45  1.1  christos TLSOBJS      = $(OBJDIR)/tls-mbedtls.o
     46  1.1  christos IOOBJS       = $(OBJDIR)/ioloop.o $(OBJDIR)/posix.o $(TLSOBJS) $(OBJDIR)/ioloop-common.o
     47  1.1  christos IOWOTLSOBJS  = $(OBJDIR)/ioloop-notls.o $(OBJDIR)/posix.o
     48  1.1  christos else ifeq ($(os), linux-uclibc)
     49  1.1  christos SRPCFLAGS = -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" -O0 -g -Wall -Werror -DSTANDALONE -I../mDNSCore -I/usr/local/include -I. -I../mDNSMacOSX/Private $(INCLUDEDIRS) -I../DSO -MMD -MF .depfile-${notdir $@} -DNOT_HAVE_SA_LEN -DUSE_SELECT -DLINUX_GETENTROPY -DGENKEY_PROGRAM=$(GENKEY) -DCERTWRITE_PROGRAM=$(CERTWRITE) -DLINUX -DSRP_CRYPTO_MBEDTLS -DPOSIX_BUILD -DMDNS_NO_STRICT
     50  1.1  christos SRPLDOPTS = -lmbedcrypto -lmbedtls -lmbedx509 -lbsd
     51  1.1  christos HMACOBJS     = $(OBJDIR)/hmac-mbedtls.o
     52  1.1  christos SIGNOBJS     = $(OBJDIR)/sign-mbedtls.o $(OBJDIR)/srp-filedata.o
     53  1.1  christos VERIFYOBJS   = $(OBJDIR)/verify-mbedtls.o
     54  1.1  christos TLSOBJS      = $(OBJDIR)/tls-mbedtls.o
     55  1.1  christos IOOBJS       = $(OBJDIR)/ioloop.o $(OBJDIR)/posix.o $(TLSOBJS) $(OBJDIR)/ioloop-common.o
     56  1.1  christos IOWOTLSOBJS  = $(OBJDIR)/ioloop-notls.o $(OBJDIR)/posix.o
     57  1.1  christos else ifeq ($(os), raspbian)
     58  1.1  christos ifdef ASAN
     59  1.1  christos SRPCFLAGS    = -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" -O0 -g -Wall -Werror -DSTANDALONE -I../mDNSCore -I/usr/local/include -I. -I../mDNSMacOSX/Private $(INCLUDEDIRS) -I../DSO -MMD -MF .depfile-${notdir $@} -DNOT_HAVE_SA_LEN -DUSE_SELECT -DGENKEY_PROGRAM=$(GENKEY) -DCERTWRITE_PROGRAM=$(CERTWRITE) -DLINUX -DRPI -DSRP_CRYPTO_MBEDTLS -DPOSIX_BUILD -fsanitize=address -DMDNS_NO_STRICT
     60  1.1  christos SRPLDOPTS    = -lasan -lmbedtls -lmbedx509 -lmbedcrypto -lbsd
     61  1.1  christos else
     62  1.1  christos SRPCFLAGS    = -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" -O0 -g -Wall -Werror -DSTANDALONE -I../mDNSCore -I/usr/local/include -I. -I../mDNSMacOSX/Private $(INCLUDEDIRS) -I../DSO -MMD -MF .depfile-${notdir $@} -DNOT_HAVE_SA_LEN -DUSE_SELECT -DGENKEY_PROGRAM=$(GENKEY) -DCERTWRITE_PROGRAM=$(CERTWRITE) -DLINUX -DRPI -DSRP_CRYPTO_MBEDTLS -DPOSIX_BUILD -DMDNS_NO_STRICT
     63  1.1  christos SRPLDOPTS    = -lmbedtls -lmbedx509 -lmbedcrypto -lbsd
     64  1.1  christos endif
     65  1.1  christos HMACOBJS     = $(OBJDIR)/hmac-mbedtls.o
     66  1.1  christos SIGNOBJS     = $(OBJDIR)/sign-mbedtls.o $(OBJDIR)/srp-filedata.o
     67  1.1  christos VERIFYOBJS   = $(OBJDIR)/verify-mbedtls.o
     68  1.1  christos TLSOBJS      = $(OBJDIR)/tls-mbedtls.o
     69  1.1  christos IOOBJS       = $(OBJDIR)/ioloop.o $(OBJDIR)/posix.o $(TLSOBJS) $(OBJDIR)/ioloop-common.o
     70  1.1  christos IOWOTLSOBJS  = $(OBJDIR)/ioloop-notls.o $(OBJDIR)/posix.o
     71  1.1  christos else
     72  1.1  christos SRPCFLAGS=$(os) $(os_id)
     73  1.1  christos endif
     74  1.1  christos 
     75  1.1  christos all:	setup $(BUILDDIR)/srp-client $(BUILDDIR)/srp-mdns-proxy $(BUILDDIR)/keydump $(BUILDDIR)/dnssd-proxy $(BUILDDIR)/cti-server $(BUILDDIR)/srputil # $(BUILDDIR)/srp-dns-proxy $(BUILDDIR)/dnssd-relay
     76  1.1  christos 
     77  1.1  christos install: all
     78  1.1  christos 	$(INSTALL) -D $(BUILDDIR)/srp-client $(INSTALL_PREFIX)/sbin/srp-client
     79  1.1  christos 	$(INSTALL) -D $(BUILDDIR)/srp-mdns-proxy $(INSTALL_PREFIX)/sbin/srp-mdns-proxy
     80  1.1  christos 	$(INSTALL) -D $(BUILDDIR)/keydump $(INSTALL_PREFIX)/bin/keydump
     81  1.1  christos 	$(INSTALL) -D $(BUILDDIR)/dnssd-proxy $(INSTALL_PREFIX)/sbin/dnssd-proxy
     82  1.1  christos 	$(INSTALL) -D $(BUILDDIR)/srp-dns-proxy $(INSTALL_PREFIX)/sbin/srp-dns-proxy
     83  1.1  christos #	$(INSTALL) -D $(BUILDDIR)/dnssd-relay $(INSTALL_PREFIX)/sbin/dnssd-relay
     84  1.1  christos 
     85  1.1  christos # 'setup' sets up the build directory structure the way we want
     86  1.1  christos setup:
     87  1.1  christos 	@if test ! -d $(OBJDIR)   ; then mkdir -p $(OBJDIR)   ; fi
     88  1.1  christos 	@if test ! -d $(BUILDDIR) ; then mkdir -p $(BUILDDIR) ; fi
     89  1.1  christos 
     90  1.1  christos # clean removes targets and objects
     91  1.1  christos clean:
     92  1.1  christos 	@if test -d $(OBJDIR)   ; then rm -r $(OBJDIR)   ; fi
     93  1.1  christos 	@if test -d $(BUILDDIR) ; then rm -r $(BUILDDIR) ; fi
     94  1.1  christos 
     95  1.1  christos SIMPLEOBJS   = $(OBJDIR)/towire.o $(SIGNOBJS)
     96  1.1  christos DSOOBJS      = $(OBJDIR)/dso.o $(OBJDIR)/dso-utils.o
     97  1.1  christos MDNSOBJS     = $(OBJDIR)/dnssd_clientstub.o $(OBJDIR)/dnssd_ipc.o $(OBJDIR)/dnssd_clientlib.o
     98  1.1  christos FROMWIREOBJS = $(OBJDIR)/fromwire.o $(VERIFYOBJS) $(OBJDIR)/wireutils.o
     99  1.1  christos CFOBJS       = $(OBJDIR)/config-parse.o
    100  1.1  christos CTIOBJS      = $(OBJDIR)/cti-services.o $(OBJDIR)/cti-proto.o
    101  1.1  christos $(BUILDDIR)/dnssd-relay:  $(OBJDIR)/dnssd-relay.o $(DSOOBJS) $(IOOBJS) $(CFOBJS)
    102  1.1  christos 	$(CC) -o $@ $+ $(SRPLDOPTS)
    103  1.1  christos 
    104  1.1  christos $(BUILDDIR)/dnssd-proxy:  $(OBJDIR)/dnssd-proxy.o $(SIMPLEOBJS) $(DSOOBJS) $(MDNSOBJS) $(FROMWIREOBJS) $(IOOBJS) $(CFOBJS) $(OBJDIR)/srp-log.o
    105  1.1  christos 	$(CC) -o $@ $+ $(SRPLDOPTS)
    106  1.1  christos 
    107  1.1  christos $(BUILDDIR)/srp-client:	$(OBJDIR)/srp-ioloop.o $(OBJDIR)/srp-client.o $(OBJDIR)/dnssd_clientlib.o $(CTIOBJS) $(SIMPLEOBJS) $(IOWOTLSOBJS) $(CFOBJS) $(DSOOBJS) $(FROMWIREOBJS)
    108  1.1  christos 	$(CC) -o $@ $+ $(SRPLDOPTS)
    109  1.1  christos 
    110  1.1  christos $(BUILDDIR)/srp-dns-proxy:	$(OBJDIR)/srp-dns-proxy.o $(OBJDIR)/srp-parse.o $(SIMPLEOBJS) $(FROMWIREOBJS) $(IOOBJS) $(HMACOBJS) $(CFOBJS)
    111  1.1  christos 	$(CC) -o $@ $+ $(SRPLDOPTS)
    112  1.1  christos 
    113  1.1  christos $(BUILDDIR)/srp-mdns-proxy:	$(OBJDIR)/srp-mdns-proxy.o $(OBJDIR)/srp-parse.o $(OBJDIR)/route.o $(OBJDIR)/omr-watcher.o $(OBJDIR)/adv-ctl-server.o $(OBJDIR)/combined-dnssd-proxy.o $(OBJDIR)/srp-replication.o $(OBJDIR)/srp-log.o $(CTIOBJS) $(MDNSOBJS) $(SIMPLEOBJS) $(DSOOBJS) $(FROMWIREOBJS) $(IOOBJS) $(HMACOBJS) $(CFOBJS)
    114  1.1  christos 	$(CC) -o $@ $+ $(SRPLDOPTS)
    115  1.1  christos 
    116  1.1  christos $(BUILDDIR)/keydump:	$(OBJDIR)/keydump.o $(MDNSOBJS) $(SIMPLEOBJS) $(FROMWIREOBJS) $(IOOBJS)
    117  1.1  christos 	$(CC) -o $@ $+ $(SRPLDOPTS)
    118  1.1  christos 
    119  1.1  christos $(BUILDDIR)/cti-server:	$(OBJDIR)/cti-server.o $(OBJDIR)/cti-proto-noioloop.o
    120  1.1  christos 	$(CC) -o $@ $+ $(SRPLDOPTS)
    121  1.1  christos 
    122  1.1  christos $(BUILDDIR)/srputil:	$(OBJDIR)/srputil.o $(OBJDIR)/advertising_proxy_services.o $(CTIOBJS) $(MDNSOBJS) $(SIMPLEOBJS) $(FROMWIREOBJS) $(IOOBJS)
    123  1.1  christos 	$(CC) -o $@ $+ $(SRPLDOPTS)
    124  1.1  christos 
    125  1.1  christos $(OBJDIR)/dso.o:	../DSO/dso.c
    126  1.1  christos 	$(CC) -o $@ $(SRPCFLAGS) $(CFLAGS) -c -I. $(INCLUDEDIRS) $<
    127  1.1  christos 
    128  1.1  christos $(OBJDIR)/dnssd_clientstub.o:  ../mDNSShared/dnssd_clientstub.c
    129  1.1  christos 	$(CC) -o $@ $(SRPCFLAGS) $(CFLAGS) -c -I. $(INCLUDEDIRS) $<
    130  1.1  christos 
    131  1.1  christos $(OBJDIR)/dnssd_clientlib.o:  ../mDNSShared/dnssd_clientlib.c
    132  1.1  christos 	$(CC) -o $@ $(SRPCFLAGS) $(CFLAGS) -c -I. $(INCLUDEDIRS) $<
    133  1.1  christos 
    134  1.1  christos $(OBJDIR)/dnssd_ipc.o:  ../mDNSShared/dnssd_ipc.c
    135  1.1  christos 	$(CC) -o $@ $(SRPCFLAGS) $(CFLAGS) -c -I. $(INCLUDEDIRS) $<
    136  1.1  christos 
    137  1.1  christos $(OBJDIR)/srputil.o: ../Clients/srputil/srputil.c
    138  1.1  christos 	$(CC) -o $@ $(SRPCFLAGS) $(CFLAGS) -c -I. $(INCLUDEDIRS) $<
    139  1.1  christos 
    140  1.1  christos $(OBJDIR)/ioloop-notls.o: ioloop.c
    141  1.1  christos 	$(CC) -o $@ $(SRPCFLAGS) $(CFLAGS) -DEXCLUDE_TLS -DEXCLUDE_DNSSD_TXN_SUPPORT -c  $<
    142  1.1  christos 
    143  1.1  christos $(OBJDIR)/cti-proto-noioloop.o: cti-proto.c
    144  1.1  christos 	$(CC) -o $@ $(SRPCFLAGS) $(CFLAGS) -DNO_IOLOOP -c  $<
    145  1.1  christos 
    146  1.1  christos $(OBJDIR)/cti-server.o: cti-server.c
    147  1.1  christos 	$(CC) -o $@ $(SRPCFLAGS) $(CFLAGS) -DNO_IOLOOP -c  $<
    148  1.1  christos 
    149  1.1  christos $(OBJDIR)/dnssd-proxy.o: dnssd-proxy.c
    150  1.1  christos 	$(CC) -o $@ $(SRPCFLAGS) $(CFLAGS) -DSRP_FEATURE_DYNAMIC_CONFIGURATION=0 -DSRP_FEATURE_COMBINED_SRP_DNSSD_PROXY=0 -DTHREAD_BORDER_ROUTER=0 -DSRP_FEATURE_REPLICATION=0 -c  $<
    151  1.1  christos 
    152  1.1  christos $(OBJDIR)/combined-dnssd-proxy.o: dnssd-proxy.c
    153  1.1  christos 	$(CC) -o $@ $(SRPCFLAGS) $(CFLAGS) -c  $<
    154  1.1  christos 
    155  1.1  christos $(OBJDIR)/%.o:	%.c
    156  1.1  christos 	$(CC) -o $@ $(SRPCFLAGS) $(CFLAGS) -c  $<
    157  1.1  christos 
    158  1.1  christos -include .depfile-adv-ctl-server.o
    159  1.1  christos -include .depfile-advertising_proxy_services.o
    160  1.1  christos -include .depfile-combined-dnssd-proxy.o
    161  1.1  christos -include .depfile-config-parse.o
    162  1.1  christos -include .depfile-cti-proto-noioloop.o
    163  1.1  christos -include .depfile-cti-proto.o
    164  1.1  christos -include .depfile-cti-server.o
    165  1.1  christos -include .depfile-cti-services.o
    166  1.1  christos -include .depfile-dnssd_clientlib.o
    167  1.1  christos -include .depfile-dnssd_clientstub.o
    168  1.1  christos -include .depfile-dnssd_ipc.o
    169  1.1  christos -include .depfile-dnssd_clientlib.o
    170  1.1  christos -include .depfile-dnssd-proxy.o
    171  1.1  christos -include .depfile-dso.o
    172  1.1  christos -include .depfile-fromwire.o
    173  1.1  christos -include .depfile-hmac-mbedtls.o
    174  1.1  christos -include .depfile-ioloop-common.o
    175  1.1  christos -include .depfile-ioloop-notls.o
    176  1.1  christos -include .depfile-ioloop.o
    177  1.1  christos -include .depfile-keydump.o
    178  1.1  christos -include .depfile-posix.o
    179  1.1  christos -include .depfile-route.o
    180  1.1  christos -include .depfile-sign-mbedtls.o
    181  1.1  christos -include .depfile-srp-client.o
    182  1.1  christos -include .depfile-srp-filedata.o
    183  1.1  christos -include .depfile-srp-ioloop.o
    184  1.1  christos -include .depfile-srp-mdns-proxy.o
    185  1.1  christos -include .depfile-srp-parse.o
    186  1.1  christos -include .depfile-srp-replication.o
    187  1.1  christos -include .depfile-srputil.o
    188  1.1  christos -include .depfile-tls-mbedtls.o
    189  1.1  christos -include .depfile-towire.o
    190  1.1  christos -include .depfile-verify-mbedtls.o
    191  1.1  christos -include .depfile-wireutils.o
    192