home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / nmap254b.zip / Makefile < prev    next >
Makefile  |  2002-02-27  |  10KB  |  223 lines

  1. # Generated automatically from Makefile.in by configure.
  2. NMAP_VERSION = 2.54BETA30
  3. NMAP_NAME= nmap
  4. NMAP_URL= www.insecure.org/nmap/
  5. NMAP_PLATFORM=i386-pc-os2_emx
  6. prefix = /usr/local
  7. exec_prefix = ${prefix}
  8. bindir = ${exec_prefix}/bin
  9. sbindir = ${exec_prefix}/sbin
  10. mandir = ${prefix}/man
  11. srcdir = .
  12. nmapdatadir = ${prefix}/share/nmap
  13. deskdir = $(prefix)/share/gnome/apps/Utilities
  14.  
  15. NBASEDIR=nbase
  16. CC = gcc.exe
  17. CCOPT = 
  18. LIBPCAPDIR = libpcap-possiblymodified
  19. INCLS = -I$(LIBPCAPDIR) 
  20. DEFS = -DHAVE_CONFIG_H -DNMAP_VERSION=\"$(NMAP_VERSION)\" -DNMAP_NAME=\"$(NMAP_NAME)\" -DNMAP_URL=\"$(NMAP_URL)\" -DNMAP_PLATFORM=\"$(NMAP_PLATFORM)\" -DNMAPDATADIR=\"$(nmapdatadir)\"
  21. CFLAGS = -g -O2 -m486 -Zmt -Zomf -D__ST_MT_ERRNO__ -I/usr/local/include -Wall  -Inbase $(CCOPT) $(DEFS) $(INCLS)
  22. # CFLAGS = -g -Wall $(DEFS) $(INCLS)
  23. STATIC = 
  24. LDFLAGS = -Zmt -Zomf -Zcrtdll -Zsysv-signals -Zbin-files -L/usr/local/lib -Lnbase $(STATIC)
  25. LIBS =  -lsocket -lm  -lnbase -lpcap -lipspy
  26. # LIBS =  -lefence -lpcap -lsocket -lm  -lnbase -lpcap
  27. # LIBS =  -lrmalloc -lpcap -lsocket -lm  -lnbase -lpcap
  28. SHTOOL = ./shtool
  29. INSTALL = $(SHTOOL) install 
  30. MAKEDEPEND = @MAKEDEPEND@
  31. RPMTDIR=$(HOME)/rpmdir
  32.  
  33. TARGET = nmap
  34.  
  35. SRCS = nmap.c targets.c tcpip.c nmap_error.c utils.c idle_scan.c osscan.c output.c scan_engine.c timing.c charpool.c services.c protocols.c nmap_rpc.c portlist.c 
  36.  
  37. OBJS = nmap.o targets.o tcpip.o nmap_error.o utils.o idle_scan.o osscan.o output.o scan_engine.o timing.o charpool.o services.o protocols.o nmap_rpc.o portlist.o 
  38.  
  39. DEPS = nmap.h nmap_error.h targets.h idle_scan.h osscan.h output.h scan_engine.h timing.h tcpip.h utils.h global_structures.h charpool.h services.h protocols.h nmap_rpc.h portlist.h
  40.  
  41. all: $(TARGET) nmapfe/nmapfe
  42.  
  43. $(TARGET): $(DEPS) $(LIBPCAPDIR)/libpcap.a $(NBASEDIR)/libnbase.a $(OBJS)
  44.     @echo Compiling nmap
  45.     rm -f $@
  46.     $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) nmap.def
  47.  
  48. $(LIBPCAPDIR)/libpcap.a: $(LIBPCAPDIR)/Makefile
  49.     @echo Compiling libpcap; cd $(LIBPCAPDIR); $(MAKE)
  50.  
  51. $(NBASEDIR)/libnbase.a: $(NBASEDIR)/Makefile
  52.     @echo Compiling libnbase;
  53.     cd $(NBASEDIR); $(MAKE)
  54.  
  55. #$(LIBPCAPDIR)/Makefile:
  56. #    @echo Configuring libpcap; cd $(LIBPCAPDIR); ./configure
  57.  
  58. nmapfe/nmapfe: 
  59.     @echo "FAILURES HERE ARE OK -- THEY JUST MEAN YOU CANNOT USE nmapfe"
  60. #    -rm -f nmapfe/Makefile
  61. #    -cd nmapfe; ./configure;
  62.     -cd nmapfe; test -f Makefile && $(MAKE) VERSION=0.$(NMAP_VERSION) STATIC=$(STATIC);
  63.     @echo "END OF SECTION WHERE FAILURES ARE OK"
  64.  
  65. # This target is just for me ... don't you get any ideas --Fyodor
  66. distro: 
  67.     autoconf
  68.     rm -f config.cache
  69.     ./configure
  70.     cd $(LIBPCAPDIR) && ./configure
  71.     $(MAKE) clean
  72.     $(MAKE)
  73.     ./nmap -h > /dev/null    #Make sure nmap exists
  74.     rm -f docs/nmap.usage.txt    
  75.     ./nmap -h > docs/nmap.usage.txt 
  76.     rm -f docs/nmap_manpage.html
  77. # nodepage option is included in man2html because of bug in that program which causes it to
  78. # drop lines if you let it try to delete page breaks
  79.     nroff -man docs/nmap.1 | man2html -nodepage -title 'Nmap network security scanner man page' > docs/nmap_manpage.html
  80.     nroff -man docs/nmap_spanish.1 | man2html -nodepage -title 'Nmap network security scanner man page (Spanish translation)' > docs/nmap_manpage-es.html
  81.     nroff -man docs/nmap_italian.1 | man2html -nodepage -title 'Nmap network security scanner man page (Italian translation)' > docs/nmap_manpage-it.html
  82.     nroff -man docs/nmap_portuguese.1 | man2html -nodepage -title 'Nmap network security scanner man page (Portuguese translation)' > docs/nmap_manpage-pt.html
  83.     nroff -Tlatin1 -man docs/nmap_lithuanian.1 | man2html -nodepage -title 'Nmap network security scanner man page (Lithuanian translation)' > docs/nmap_manpage-lt.html
  84. # We need a content-type for the Lithuanian version
  85.     sr '<HEAD>' '<HEAD><META http-equiv="Content-Type" content="text/html; charset=windows-1257">' docs/nmap_manpage-lt.html
  86.     rm -rf /usr/tmp/nmap-$(NMAP_VERSION)
  87.     mkdir /usr/tmp/nmap-$(NMAP_VERSION)
  88. # Make the RPM .spec file
  89.     sed -e s/\@VERSION\@/$(NMAP_VERSION)/g nmap.spec.in > nmap-$(NMAP_VERSION)-1.spec
  90.     $(MAKE) clean
  91.     rm -f $(LIBPCAPDIR)/config.cache $(LIBPCAPDIR)/Makefile
  92.     unix2dos README-WIN32
  93.     cp -ra $(SRCS) $(DEPS) nmap-os-fingerprints \
  94.     nmapfe.desktop nmap-services nmap-rpc nmap-protocols \
  95.     configure.in config.h.in nmap_winconfig.h Makefile.in configure \
  96.         $(SHTOOL) install-sh config.guess nmap-$(NMAP_VERSION)-1.spec \
  97.             config.sub INSTALL README-WIN32 COPYING CHANGELOG HACKING \
  98.             /usr/tmp/nmap-$(NMAP_VERSION)
  99.     $(SHTOOL) mkdir /usr/tmp/nmap-$(NMAP_VERSION)/mswin32
  100.     cd mswin32; cp -ra *.[hHcC] ARPA NET NETINET RPC icon1.ico \
  101.                     ifaddrlist.h lib libpcap-note.txt nmap.dsp \
  102.                     nmap.dsw nmap.rc winip \
  103.                     /usr/tmp/nmap-$(NMAP_VERSION)/mswin32
  104.     $(SHTOOL) mkdir /usr/tmp/nmap-$(NMAP_VERSION)/$(LIBPCAPDIR)
  105.     cd $(LIBPCAPDIR); cp -ra CHANGES CREDITS CVS FILES INSTALL LICENSE \
  106.             Makefile.in NMAP_MODIFICATIONS README README.aix README.linux \
  107.             SUNOS4 TODO VERSION aclocal.m4 bpf bpf_dump.c bpf_image.c \
  108.             config.h.in configure configure.in etherent.c ethertype.h \
  109.             gencode.c gencode.h grammar.c grammar.y \
  110.             inet.c lbl llc.h mkdep nametoaddr.c nlpid.h \
  111.             optimize.c pcap-bpf.c pcap-dlpi.c pcap-enet.c pcap-int.h \
  112.             pcap-linux.c pcap-namedb.h pcap-nit.c pcap-nit.h pcap-null.c \
  113.             pcap-pf.c pcap-pf.h pcap-snit.c pcap-snoop.c pcap.3 pcap.c \
  114.             pcap.h ppp.h savefile.c scanner.c scanner.l sll.h tokdefs.h \
  115.             /usr/tmp/nmap-$(NMAP_VERSION)/$(LIBPCAPDIR)
  116.  
  117.     $(SHTOOL) mkdir /usr/tmp/nmap-$(NMAP_VERSION)/docs
  118.     cd docs; cp -ra README copying.html nmap-fingerprinting-article.txt \
  119.                     nmap.1 nmap.deprecated.txt nmap.usage.txt nmap_doc.html \
  120.                     nmap_manpage-es.html nmap_manpage-fr.html \
  121.                     nmap_manpage-lt.html nmap_manpage-ru.html \
  122.                 nmap_manpage-it.html nmap_manpage.html \
  123.                     nmap_spanish.1 nmap_lithuanian.1 nmap_italian.1 \
  124.                     nmap_portuguese.1 nmapfe.1 \
  125.                 xnmap.1 nmap.dtd \
  126.                     /usr/tmp/nmap-$(NMAP_VERSION)/docs
  127.     $(SHTOOL) mkdir /usr/tmp/nmap-$(NMAP_VERSION)/nmapfe
  128.     cd nmapfe; cp -ra Makefile.in aclocal.m4 configure configure.in \
  129.                   nmapfe.c nmapfe.h nmapfe_sig.c nmapfe_sig.h \
  130.                   nmapfe_error.c nmapfe_error.h NmapFE.dsp nmapfe.dsw \
  131.                   /usr/tmp/nmap-$(NMAP_VERSION)/nmapfe
  132.     $(SHTOOL) mkdir /usr/tmp/nmap-$(NMAP_VERSION)/nbase
  133.     cd $(NBASEDIR); cp -ra Makefile.in aclocal.m4 configure configure.in \
  134.                  nbase_config.h.in \
  135.                      *.c *.h CHANGELOG /usr/tmp/nmap-$(NMAP_VERSION)/nbase
  136.  
  137.     rm -f /usr/tmp/nmap-$(NMAP_VERSION)/nbase/nbase_config.h 
  138. # Kill the CVS crap
  139.     find /usr/tmp/nmap-$(NMAP_VERSION) -type d -name CVS | xargs rm -rf
  140.     find /usr/tmp/nmap-$(NMAP_VERSION) -exec chmod go=u-w '{}' \;
  141.     cd /usr/tmp; \
  142.     tar czf nmap-$(NMAP_VERSION).tgz nmap-$(NMAP_VERSION)
  143. # Make the actual RPM
  144.     rpm -ta /usr/tmp/nmap-$(NMAP_VERSION).tgz
  145.     cp -f $(RPMTDIR)/RPMS/i386/nmap-$(NMAP_VERSION)-1.i386.rpm /usr/tmp
  146.     cp -f $(RPMTDIR)/RPMS/i386/nmap-frontend-0.$(NMAP_VERSION)-1.i386.rpm /usr/tmp
  147.     cp -f $(RPMTDIR)/SRPMS/nmap-$(NMAP_VERSION)-1.src.rpm /usr/tmp
  148.     rm -rf /usr/tmp/nmap-$(NMAP_VERSION)
  149.  
  150. # For distributing the binary
  151. static:     
  152.     cd $(LIBPCAPDIR); $(MAKE)
  153.     $(CC) $(CFLAGS) -static $(LDFLAGS) -o nmap.linux.bin  $(SRCS) $(LIBS)
  154.     strip nmap.linux.bin
  155.  
  156. clean: pcap_clean nmapfe_clean nbase_clean my_clean
  157.  
  158. my_clean:
  159.     rm -f $(OBJS) $(TARGET) config.cache
  160. pcap_clean:
  161.     cd $(LIBPCAPDIR); $(MAKE) clean
  162. nmapfe_clean:
  163.     cd nmapfe; $(MAKE) clean
  164. nbase_clean:
  165.     cd $(NBASEDIR); $(MAKE) clean
  166. pcap_dist_clean:
  167.     cd $(LIBPCAPDIR); $(MAKE) distclean
  168.  
  169. distclean: my_clean my_distclean pcap_dist_clean
  170. my_distclean:
  171.     rm -f Makefile Makefile.bak config.h stamp-h stamp-h.in \
  172.              config.cache config.log config.status
  173.  
  174. depend:
  175.     $(MAKEDEPEND) $(INCLS) -s "# DO NOT DELETE" -- $(DEFS) -- $(SRCS)
  176.  
  177. install: $(TARGET)
  178.     $(SHTOOL) mkdir -f -p -m 755 $(bindir) $(mandir)/man1 $(nmapdatadir) $(deskdir)
  179.     $(INSTALL) -c -m 755 nmap $(bindir)/nmap
  180.     @echo "If the next command fails -- you cannot use the X front end"
  181.     -test -f nmapfe/nmapfe && $(INSTALL) -c -m 755 nmapfe/nmapfe $(bindir)/nmapfe && $(SHTOOL) mkln -f -s $(bindir)/nmapfe $(bindir)/xnmap && $(INSTALL) -c -m 644 nmapfe.desktop $(deskdir)/nmapfe.desktop && $(INSTALL) -c -m 644 docs/nmapfe.1 $(mandir)/man1/nmapfe.1 && $(INSTALL) -c -m 644 docs/xnmap.1 $(mandir)/man1/xnmap.1
  182.     $(INSTALL) -c -m 644 docs/$(TARGET).1 $(mandir)/man1/$(TARGET).1
  183.     $(INSTALL) -c -m 644 nmap-os-fingerprints  $(nmapdatadir)/nmap-os-fingerprints
  184.     $(INSTALL) -c -m 644 nmap-services  $(nmapdatadir)/nmap-services
  185.     $(INSTALL) -c -m 644 nmap-protocols  $(nmapdatadir)/nmap-protocols
  186.     $(INSTALL) -c -m 644 nmap-rpc  $(nmapdatadir)/nmap-rpc
  187.  
  188. uninstall:
  189.     rm -f $(bindir)/$(TARGET) $(bindir)/nmapfe $(bindir)/xnmap
  190.     rm -f $(deskdir)/nmapfe.desktop $(mandir)/man1/nmapfe.1
  191.     rm -f $(mandir)/man1/xnmap.1 $(mandir)/man1/nmap.1
  192.     rm -rf $(nmapdatadir) 
  193.     rm -f $(bindir)/$(TARGET)
  194.  
  195. ${srcdir}/configure: configure.in 
  196.     cd ${srcdir} && autoconf
  197.  
  198. # autoheader might not change config.h.in, so touch a stamp file.
  199. ${srcdir}/config.h.in: stamp-h.in
  200. ${srcdir}/stamp-h.in: configure.in acconfig.h \
  201.     config.h.top config.h.bot
  202.     cd ${srcdir} && autoheader
  203.     echo timestamp > ${srcdir}/stamp-h.in
  204.  
  205. config.h: stamp-h
  206. stamp-h: config.h.in config.status
  207.     ./config.status
  208.  
  209. Makefile: Makefile.in config.status
  210.     ./config.status
  211.  
  212. config.status: configure
  213.     ./config.status --recheck
  214.  
  215. # DO NOT DELETE -- Needed by makedepend
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.