"Fossies" - the Fresh Open Source Software Archive

Member "whois/Makefile" (31 Dec 2019, 4448 Bytes) of package /linux/privat/whois_5.5.9.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "Makefile": 5.5.2_vs_5.5.3.

    1 prefix = /usr
    2 
    3 ifdef DESTDIR
    4 BASEDIR := $(DESTDIR)
    5 endif
    6 
    7 CFLAGS ?= -g -O2
    8 
    9 PKG_CONFIG ?= pkg-config
   10 PERL ?= perl
   11 INSTALL ?= install
   12 
   13 whois_OBJECTS := whois.o utils.o
   14 mkpasswd_OBJECTS := mkpasswd.o utils.o
   15 
   16 ##############################################################################
   17 # Solaris
   18 #whois_LDADD += -lnsl -lsocket -liconv
   19 
   20 # FreeBSD
   21 #whois_LDADD += -liconv
   22 #LIBS += -L/usr/local/lib -lintl
   23 #DEFS += -I/usr/local/include
   24 
   25 # OS/2 EMX
   26 #whois_LDADD += -lsocket
   27 #LDFLAGS += -Zexe -Dstrncasecmp=strnicmp
   28 
   29 # OS X
   30 #whois_LDADD += -liconv
   31 
   32 ifdef CONFIG_FILE
   33 DEFS += -DCONFIG_FILE=\"$(CONFIG_FILE)\"
   34 endif
   35 
   36 ifdef LOCALEDIR
   37 DEFS += -DLOCALEDIR=\"$(BASEDIR)$(prefix)/share/locale\"
   38 endif
   39 
   40 # libidn support has been autodetected since 5.2.18
   41 ifdef HAVE_LIBIDN
   42 $(error Please fix your build system to stop defining HAVE_LIBIDN!)
   43 endif
   44 
   45 ifeq ($(shell $(PKG_CONFIG) --exists 'libidn2 >= 2.0.3' || echo NO),)
   46 whois_LDADD += $(shell $(PKG_CONFIG) --libs libidn2)
   47 DEFS += -DHAVE_LIBIDN2 $(shell $(PKG_CONFIG) --cflags libidn2)
   48 else ifeq ($(shell $(PKG_CONFIG) --exists 'libidn' || echo NO),)
   49 whois_LDADD += $(shell $(PKG_CONFIG) --libs libidn)
   50 DEFS += -DHAVE_LIBIDN $(shell $(PKG_CONFIG) --cflags libidn)
   51 endif
   52 
   53 ifdef HAVE_ICONV
   54 whois_OBJECTS += simple_recode.o
   55 DEFS += -DHAVE_ICONV
   56 endif
   57 
   58 ifeq ($(shell $(PKG_CONFIG) --exists 'libxcrypt >= 4.1' || echo NO),)
   59 DEFS += -DHAVE_CRYPT_H -DHAVE_LINUX_CRYPT_GENSALT $(shell $(PKG_CONFIG) --cflags libcrypt)
   60 mkpasswd_LDADD += $(shell $(PKG_CONFIG) --libs libcrypt)
   61 else ifdef HAVE_XCRYPT
   62 DEFS += -DHAVE_XCRYPT_H -DHAVE_LINUX_CRYPT_GENSALT
   63 mkpasswd_LDADD += -lxcrypt
   64 else ifdef HAVE_LIBOWCRYPT
   65 # owl and openSUSE have crypt_gensalt(3) in libowcrypt
   66 DEFS += -DHAVE_CRYPT_H -DHAVE_LINUX_CRYPT_GENSALT -D_OW_SOURCE
   67 mkpasswd_LDADD += -lcrypt -lowcrypt
   68 else
   69 mkpasswd_LDADD += -lcrypt
   70 endif
   71 
   72 CPPFLAGS += $(DEFS) $(INCLUDES)
   73 
   74 ##############################################################################
   75 all: Makefile.depend whois mkpasswd pos
   76 
   77 ##############################################################################
   78 %.o: %.c
   79 	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
   80 
   81 whois: $(whois_OBJECTS)
   82 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(whois_LDADD) $(LIBS)
   83 
   84 mkpasswd: $(mkpasswd_OBJECTS)
   85 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(mkpasswd_LDADD) $(LIBS)
   86 
   87 ##############################################################################
   88 version.h: debian/changelog make_version_h.pl
   89 	$(PERL) make_version_h.pl $< > $@
   90 
   91 as_del.h: as_del_list make_as_del.pl
   92 	$(PERL) make_as_del.pl < $< > $@
   93 
   94 as32_del.h: as32_del_list make_as32_del.pl
   95 	$(PERL) make_as32_del.pl < $< > $@
   96 
   97 ip_del.h: ip_del_list make_ip_del.pl
   98 	$(PERL) make_ip_del.pl < $< > $@
   99 
  100 ip6_del.h: ip6_del_list make_ip6_del.pl
  101 	$(PERL) make_ip6_del.pl < $< > $@
  102 
  103 new_gtlds.h: new_gtlds_list make_new_gtlds.pl
  104 	$(PERL) make_new_gtlds.pl < $< > $@
  105 
  106 nic_handles.h: nic_handles_list make_nic_handles.pl
  107 	$(PERL) make_nic_handles.pl < $< > $@
  108 
  109 tld_serv.h: tld_serv_list make_tld_serv.pl
  110 	$(PERL) make_tld_serv.pl < $< > $@
  111 
  112 servers_charset.h: servers_charset_list make_servers_charset.pl
  113 	$(PERL) make_servers_charset.pl < $< > $@
  114 
  115 ##############################################################################
  116 afl:
  117 	-rm -f Makefile.depend
  118 	DEFS=-DAFL_MODE=1 AFL_HARDEN=1 $(MAKE) whois CC=afl-gcc HAVE_ICONV=1
  119 
  120 afl-run:
  121 	nice afl-fuzz -i ../afl_in -o ../afl_out -- ./whois
  122 
  123 ##############################################################################
  124 install: install-whois install-mkpasswd install-pos
  125 
  126 install-whois: whois
  127 	$(INSTALL) -d $(BASEDIR)$(prefix)/bin/
  128 	$(INSTALL) -d $(BASEDIR)$(prefix)/share/man/man1/
  129 	$(INSTALL) -d $(BASEDIR)$(prefix)/share/man/man5/
  130 	$(INSTALL) -m 0755 whois $(BASEDIR)$(prefix)/bin/
  131 	$(INSTALL) -m 0644 whois.1 $(BASEDIR)$(prefix)/share/man/man1/
  132 	$(INSTALL) -m 0644 whois.conf.5 $(BASEDIR)$(prefix)/share/man/man5/
  133 
  134 install-mkpasswd: mkpasswd
  135 	$(INSTALL) -d $(BASEDIR)$(prefix)/bin/
  136 	$(INSTALL) -d $(BASEDIR)$(prefix)/share/man/man1/
  137 	$(INSTALL) -m 0755 mkpasswd $(BASEDIR)$(prefix)/bin/
  138 	$(INSTALL) -m 0644 mkpasswd.1 $(BASEDIR)$(prefix)/share/man/man1/
  139 
  140 install-pos:
  141 	cd po && $(MAKE) install
  142 
  143 distclean: clean
  144 	rm -f po/whois.pot
  145 
  146 clean:
  147 	rm -f Makefile.depend as_del.h as32_del.h ip_del.h ip6_del.h \
  148 		new_gtlds.h tld_serv.h servers_charset.h *.o whois mkpasswd
  149 	rm -f po/*.mo
  150 
  151 pos:
  152 	cd po && $(MAKE)
  153 
  154 depend: Makefile.depend
  155 Makefile.depend:
  156 	$(CC) $(CPPFLAGS) $(CFLAGS) -MM -MG *.c > $@
  157 
  158 -include Makefile.depend
  159 
  160 .DELETE_ON_ERROR: