home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume39 / ncftp / part05 / Makefile < prev    next >
Encoding:
Makefile  |  1993-08-25  |  7.5 KB  |  349 lines

  1. # Makefile for ncftp
  2. # Major sections delimited by a dash lines.  If several lines set the same
  3. # make variable, you can choose between the commented #samples, or just
  4. # type what you want manually.
  5. #--------------------------------------------------------------------------
  6.  
  7.  
  8. # System dependent definitions.  See the README, part B.
  9. #--------------------------------------------------------------------------
  10. SDEFS = 
  11.  
  12.  
  13. # Program definitions.  See the README, part C.
  14. #--------------------------------------------------------------------------
  15. #PDEFS =
  16. #PDEFS = -DGETLINE
  17. #PDEFS = -DREADLINE -DCURSES
  18. #PDEFS = -DSOCKS
  19. PDEFS = -DDEBUG -DDB_ERRS
  20.  
  21.  
  22. # Choose your compiler and flags below.  Make sure you use an ANSI compiler
  23. # that handles new style function declarations and prototypes (gcc should).
  24. #--------------------------------------------------------------------------
  25. CC = cc
  26. #CC = gcc
  27.  
  28. #CFLAGS = -O
  29. CFLAGS = -g
  30.  
  31. #LFLAGS = -s
  32. LFLAGS =
  33.  
  34.  
  35. # Additional libraries and/or object files.
  36. # For each library, add -lLIBNAME to the LIBS line below, for a library
  37. #   named libLIBNAME.a.
  38. #
  39. # For each object file, just add the pathname of the object file.
  40. #
  41. # Some may need any of -lsocket, -lnet, -linet, -lintl, or -lnsl. 
  42. # You'll need -lcurses or -ltermcap if CURSES is defined.
  43. # You'll need -lreadline AND either -lcurses or -ltermcap if you
  44. #   want to use the GNU Readline library.
  45. # You'll need -lgetline (compile it as a library) if you want to use
  46. #   getline.
  47. # You'll need to know where the Rconnect.o object file is if you want
  48. #   to use Socks.
  49. #--------------------------------------------------------------------------
  50. #LIBS =
  51. #LIBS = -ldbmalloc
  52. #LIBS = -lgetline
  53. #LIBS = -lreadline -lcurses
  54. #LIBS = ../lib/Rconnect.o
  55.  
  56.  
  57. # If the libraries are in a non-standard directory, or you if want to use
  58. # getline or readline and they aren't installed system-wide, add the
  59. # extra directories to look in here, using -L's.
  60. #--------------------------------------------------------------------------
  61. #LIBDIRS =
  62. LIBDIRS = -L$(HOME)/src
  63. #LIBDIRS = -L./getline
  64. #LIBDIRS = -L./readline
  65.  
  66.  
  67. # Additional headers.
  68. # If you defined READLINE or GETLINE, you have to tell where it's header
  69. # file can be found.
  70. #--------------------------------------------------------------------------
  71. #HDRDIRS = -I.
  72. HDRDIRS = -I$(HOME)/src
  73. #HDRDIRS = -I./getline
  74. #HDRDIRS = -I./readline
  75.  
  76.  
  77. # If you want to 'make install,' edit these variables, otherwise don't
  78. # worry about it.
  79. #--------------------------------------------------------------------------
  80. BINDIR = /usr/local
  81. MANDIR = /usr/man/man1
  82. RM = rm -f
  83. CP = cp
  84.  
  85.  
  86. #************************************************
  87. #*** SHOULD NOT NEED TO EDIT BELOW THIS POINT ***
  88. #************************************************
  89.  
  90. DEFS = $(PDEFS) $(SDEFS)
  91. MK = $(CC) $(CFLAGS) $(DEFS) $(HDRDIRS) $(LFLAGS) $(LIBDIRS) $(LIBS)
  92.  
  93. NAME = ncftp
  94. MAN = ncftp.1
  95. ALL = $(SRCS) $(HEADERS) patchlevel.h Blurb README Makefile $(MAN) \
  96. v2_Note
  97.  
  98. VERS=150
  99. PKGNAME = ncftp$(VERS)
  100. TARNAME = $(PKGNAME).tar
  101.  
  102. SRCS = cmds.c cmdtab.c ftp.c ftprc.c getpass.c glob.c main.c open.c set.c \
  103. tips.c util.c
  104.   
  105. HEADERS = cmds.h copyright.h defaults.h ftp.h ftprc.h getpass.h glob.h \
  106. main.h open.h set.h sys.h util.h
  107.    
  108. OBJS = cmds.o cmdtab.o ftp.o ftprc.o getpass.o glob.o main.o open.o set.o \
  109. tips.o util.o
  110.  
  111. C_COMPILE = $(CC) $(CFLAGS) $(DEFS) $(HDRDIRS)
  112. C_COMPILE2 = $(CC) $(CFLAGS) $(DEFS) -DMK='"$(MK)"' $(HDRDIRS)
  113.  
  114. all: $(NAME) done
  115.  
  116. $(NAME): $(OBJS)
  117.     $(CC) $(LFLAGS) $(LIBDIRS) $(OBJS)  -o $(NAME) $(LIBS)
  118.  
  119. install: $(NAME)
  120.     $(CP) $(NAME) $(BINDIR)/$(NAME)
  121.     $(CP) $(MAN)  $(MANDIR)/$(MAN)
  122.  
  123. uninstall:
  124.     $(RM) $(BINDIR)/$(NAME)
  125.     $(RM) $(MANDIR)/$(MAN)
  126.  
  127. cmds.o:
  128.     $(C_COMPILE2) cmds.c -c -o cmds.o
  129.  
  130. .c.o:
  131.     $(C_COMPILE) -c $<
  132.  
  133. clean:
  134.     rm -f $(OBJS) core $(NAME)
  135.  
  136. SGI_CFLAGS = -prototypes -xansi -fullwarn -woff 211,269,270,303,309,24,51
  137. FTPDIR=/usr/people/ftp/pub/mgleason
  138.  
  139. shared: $(OBJS)
  140.      $(CC) $(OBJS)  $(LIBDIRS) -o $(NAME) -lc_s $(LIBS) -s
  141.      -@ls -l $(NAME)
  142.  
  143. lint: $(SRCS)
  144.     lint $(SRCS) $(CFLAGS) $(DEFS) > './Junk/lint'
  145.  
  146. tags:
  147.     ctags -x $(SRCS) $(HEADERS) | sort -f > tags
  148.     
  149. tar:
  150.     tar cvf - $(ALL) | compress > $(TARNAME).Z
  151.     ls -l $(TARNAME).Z
  152.  
  153. gz:
  154.     tar cvf - $(ALL) | gzip > $(TARNAME).z
  155.     ls -l $(TARNAME).z
  156.  
  157. shar2:
  158.     shar $(ALL) > $(NAME).shar
  159.  
  160. shar:
  161.     shar $(ALL) | cat Blurb - > $(NAME).shar
  162.  
  163. done: $(NAME)
  164.     -@ls -l $(NAME)
  165.     -@echo 'Done.'
  166.  
  167.  
  168. pixie: $(NAME) $(NAME).Counts $(NAME).Addrs
  169.     prof -pixie $(NAME) $(NAME).Addrs $(NAME).Counts -feedback Feedback
  170.  
  171. $(NAME).Addrs: $(NAME)
  172.     pixie -o $(NAME).pixie $(NAME)
  173.  
  174. $(NAME).Counts: ftp $(NAME).Addrs
  175.     $(NAME).pixie
  176.  
  177. profile:
  178.     rm -f *.[ou]
  179.     cc $(SGI_CFLAGS) $(SRCS) $(DEFS)  -g -p -o ncftp.prof
  180.     ncftp.prof
  181.     prof ncftp.prof mon.out
  182.  
  183. rmobjs:
  184.     -@rm -f *.[ou]
  185.  
  186. freshdebug: rmobjs
  187.     pmake "CFLAGS=$(SGI_CFLAGS) -g" LFLAGS=-g
  188.  
  189. debug:
  190.     pmake "CFLAGS=$(SGI_CFLAGS) -g" LFLAGS=-g
  191.  
  192. opt: rmobjs
  193.     pmake "CFLAGS=-O2 $(SGI_CFLAGS)" LFLAGS=-s
  194.     -@ls -l $(NAME)
  195.  
  196. shopt: opt shared
  197.  
  198. gopt: rmobjs
  199.     pmake CC=gcc "CFLAGS=-O2 $(SGI_CFLAGS)" LFLAGS=-s
  200.     -@ls -l $(NAME)
  201.  
  202. JUNK = ~/N/Junk
  203.  
  204. mantst: ncftp.1
  205.     nroff -man ncftp.1 > $(JUNK)/ncftp.man
  206.     less $(JUNK)/ncftp.man
  207.  
  208. sz:
  209.     sz -e $(ALL)
  210.  
  211. getline:
  212.     -rm util.o cmds.o tips.o
  213.     make PDEFS=-DGETLINE LIBS=-lgetline LIBDIRS=-L$(HOME)/src/ncftp/getline \
  214.         HDRDIRS=-I$(HOME)/src/ncftp/getline
  215.  
  216. finst:
  217.     -@mkdir /tmp/$(PKGNAME)
  218.     cp -r $(ALL) /tmp/$(PKGNAME)
  219.     (cd /tmp ; tar cvf - $(PKGNAME) | gzip -f > $(FTPDIR)/$(TARNAME).z )
  220.     chmod 644 $(FTPDIR)/$(TARNAME).z
  221.     -@ls -l $(FTPDIR)/$(TARNAME).z
  222.     -@rm -rf /tmp/$(PKGNAME)
  223.  
  224. depend:
  225.     cc -M $(SRCS) | grep -v '/' >> Makefile
  226.  
  227. protos:
  228.     apply "mkptypes -x -A %1 > %1.pr" $(SRCS)
  229.     -@echo 'Done.'
  230.  
  231. patch:
  232.     -rm -rf /tmp/old /tmp/new
  233.     -mkdir /tmp/old /tmp/new
  234.     cp ~/ncftp.shar /tmp/old/oldncftp.shar
  235.     (cd /tmp/old ; unshar -n oldncftp.shar )
  236.     make shar
  237.     cp ncftp.shar /tmp/new
  238.     (cd /tmp/new; unshar -n ncftp.shar )
  239.     rm /tmp/new/ncftp.shar /tmp/old/oldncftp.shar
  240.     (cd /tmp/old ; diff -c . ../new > ../pch)
  241.  
  242. coall:
  243.     co -u -f $(SRCS) $(HEADERS)
  244.  
  245. newver:
  246.     ci -Nv$(VERS) -f "-mv$(VERS) release" -M -u $(SRCS) $(HEADERS)
  247.  
  248. ciall:
  249.     ci -q -M -u $(SRCS) $(HEADERS)
  250.  
  251. # Dependencies:
  252. cmds.o: cmds.c 
  253. cmds.o: sys.h 
  254. cmds.o: util.h 
  255. cmds.o: cmds.h 
  256. cmds.o: main.h 
  257. cmds.o: ftp.h 
  258. cmds.o: ftprc.h 
  259. cmds.o: getpass.h 
  260. cmds.o: glob.h 
  261. cmds.o: set.h 
  262. cmds.o: defaults.h 
  263. cmds.o: copyright.h 
  264. cmdtab.o: cmdtab.c 
  265. cmdtab.o: sys.h 
  266. cmdtab.o: util.h 
  267. cmdtab.o: cmds.h 
  268. cmdtab.o: main.h 
  269. cmdtab.o: ftp.h 
  270. cmdtab.o: ftprc.h 
  271. cmdtab.o: glob.h 
  272. cmdtab.o: open.h 
  273. cmdtab.o: set.h 
  274. cmdtab.o: copyright.h 
  275. ftp.o: ftp.c 
  276. ftp.o: sys.h 
  277. ftp.o: util.h 
  278. ftp.o: ftp.h 
  279. ftp.o: cmds.h 
  280. ftp.o: main.h 
  281. ftp.o: ftprc.h 
  282. ftp.o: getpass.h 
  283. ftp.o: defaults.h 
  284. ftp.o: copyright.h 
  285. ftprc.o: ftprc.c 
  286. ftprc.o: sys.h 
  287. ftprc.o: util.h 
  288. ftprc.o: ftprc.h 
  289. ftprc.o: main.h 
  290. ftprc.o: cmds.h 
  291. ftprc.o: set.h 
  292. ftprc.o: defaults.h 
  293. ftprc.o: copyright.h 
  294. getpass.o: getpass.c 
  295. getpass.o: sys.h 
  296. getpass.o: util.h 
  297. getpass.o: cmds.h 
  298. getpass.o: getpass.h 
  299. getpass.o: copyright.h 
  300. glob.o: glob.c 
  301. glob.o: sys.h 
  302. glob.o: util.h 
  303. glob.o: glob.h 
  304. glob.o: cmds.h 
  305. glob.o: copyright.h 
  306. main.o: main.c 
  307. main.o: sys.h 
  308. main.o: util.h 
  309. main.o: cmds.h 
  310. main.o: main.h 
  311. main.o: ftp.h 
  312. main.o: ftprc.h 
  313. main.o: open.h 
  314. main.o: set.h 
  315. main.o: defaults.h 
  316. main.o: copyright.h 
  317. open.o: open.c 
  318. open.o: sys.h 
  319. open.o: util.h 
  320. open.o: open.h 
  321. open.o: cmds.h 
  322. open.o: ftp.h 
  323. open.o: ftprc.h 
  324. open.o: main.h 
  325. open.o: defaults.h 
  326. open.o: copyright.h 
  327. set.o: set.c 
  328. set.o: sys.h 
  329. set.o: util.h 
  330. set.o: cmds.h 
  331. set.o: main.h 
  332. set.o: set.h 
  333. set.o: defaults.h 
  334. set.o: copyright.h 
  335. tips.o: tips.c 
  336. tips.o: sys.h 
  337. tips.o: util.h 
  338. util.o: util.c 
  339. util.o: sys.h 
  340. util.o: util.h 
  341. util.o: cmds.h 
  342. util.o: main.h 
  343. util.o: ftp.h 
  344. util.o: ftprc.h 
  345. util.o: defaults.h 
  346. util.o: copyright.h 
  347.