PageRenderTime 138ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/src/Makefile

https://gitlab.com/qbarnes/unix-notes
Makefile | 309 lines | 193 code | 46 blank | 70 comment | 1 complexity | c6177a1b3bac0c4d41a5b3e7c4b24eb0 MD5 | raw file
  1. # Makefile for University of Illinois Notesfiles
  2. #
  3. # $Header: /usr/local/src/usenet/notes/src/RCS/Makefile,v 1.10 88/11/30 11:02:46 paul Exp $
  4. #
  5. # Ray Essick
  6. # 214 DCL
  7. # University of Illinois at Urbana-Champaign
  8. # 1304 W. Springfield
  9. # Urbana, Illinois 61801
  10. # 217-333-7937
  11. #
  12. BIN = /usr/local/notes
  13. MSTDIR = /usr/spool/notes
  14. ARCHDIR = /usr/spool/oldnotes
  15. NET = /usr/local/notes
  16. AUTOSEQ = autoseq
  17. NOTES = notes
  18. NOTESUID = 133
  19. NOTESGRP = notes
  20. ANON = nobody
  21. ANONUID = 32767
  22. LIBDIR = /usr/local/lib
  23. #CC = gcc -std=c89 -Wparentheses
  24. CC = /opt/local/bin/gcc-mp-4.8 -std=c89
  25. CFLAGS = -DMSTDIR=\"$(MSTDIR)\" -DARCHDIR=\"$(ARCHDIR)\" \
  26. -DNOTES=\"$(NOTES)\" -DNOTESUID=$(NOTESUID) -DNOTESGRP=\"$(NOTESGRP)\" \
  27. -DANON=\"$(ANON)\" -DANONUID=$(ANONUID) \
  28. -DBIN=\"$(BIN)\" -O
  29. CCFLAGS = -DMSTDIR='\"$(MSTDIR)\"' -DARCHDIR='\"$(ARCHDIR)\"' \
  30. -DNOTES='\"$(NOTES)\"' -DNOTESUID=$(NOTESUID) -DNOTESGRP='\"$(NOTESGRP)\"' \
  31. -DANON='\"$(ANON)\"' -DANONUID=$(ANONUID) \
  32. -DBIN='\"$(BIN)\"' -O
  33. #LFLAGS = -i
  34. # -n is shared, read-only text segment
  35. TERMCAP = -L /opt/local/lib -ltermcap -L/usr/lib
  36. #TERMCAP = /opt/local/lib/libtermcap.dylib
  37. # Evidently on System V (and other USG systems?) the termcap routines
  38. # are in /usr/lib/libcurses.a
  39. #
  40. # The following probably don't need to be modified
  41. #
  42. UTILITY = $(MSTDIR)/.utilities
  43. SEQUENCER = $(MSTDIR)/.sequencer
  44. LOCKS = $(MSTDIR)/.locks
  45. ALIASES = $(UTILITY)/net.aliases
  46. UNIQID = $(MSTDIR)/.SEQ
  47. # directory where the "release" copy is kept
  48. DISTDIR= p:/usr/src/uiuc/notesfiles
  49. DCP= rcp
  50. RCSID = 1.7.0
  51. RCSSTATE = Rel
  52. RCSIFLAGS = -r$(RCSID) -s$(RCSSTATE)
  53. RCSOFLAGS = -r$(RCSID) -s$(RCSSTATE)
  54. #
  55. # Define some collections of routines so that things will
  56. # be easy to maintain
  57. #
  58. MISCFILES = Makefile Distfile rinstall getdate.y
  59. HFILES = canon.h doc.h net.h newsgate.h parms.h structs.h dump.h
  60. HLPFILES = access.help dir.help index.help lim.help read.help
  61. CFILES = access.c adnote.c adresp.c archiver.c asearch.c buildnf.c check.c \
  62. checknotes.c compress.c control.c cursor.c datein.c delete.c \
  63. dmpnote.c dmpresp.c dropt.c dsply.c find.c gdate.c getnet.c \
  64. gname.c gtext.c gtime.c help.c index.c ldmisc.c limindx.c loadem.c \
  65. lprnote.c lrsp.c mailit.c main.c misc.c miscio.c mknf.c newsdump.c \
  66. newsgroup.c newsinput.c newsout.c newsoutput.c next.c nfalias.c \
  67. nfarchive.c nfcomment.c nfmail.c nfpipe.c nfprint.c nfrcv.c nfsend.c \
  68. nfstats.c nfxmit.c note.c pagein.c pageout.c pattern.c permit.c \
  69. perms.c preptxt.c prtind.c readem.c recsio.c resp.c rmnf.c \
  70. savtxt.c startup.c talkto.c times.c tsearch.c \
  71. expand.c newspath.c nfaccess.c acssort.c nfabort.c \
  72. nfdump.c dump.c nfload.c loadnf.c parse.c loadvars.c \
  73. bnewshead.c loadproto1.c ftime.c parsepath.c pagemove.c \
  74. nftimestamp.c nfadmin.c strcasecmp.c
  75. USERCMDS = main nfpipe nfprint nfstats checknotes
  76. NETCMDS = nfxmit nfrcv newsinput newsoutput
  77. UTILCMDS = mknf rmnf nfadmin nfarchive nfaccess nfmail nftimestamp
  78. MISCCMDS = nfload nfdump
  79. CMDS = $(USERCMDS) $(NETCMDS) $(UTILCMDS) $(MISCCMDS)
  80. #
  81. # Objects (other than the mainline) to load with each program
  82. #
  83. LIBOBJS = nfabort.o nfcomment.o
  84. #
  85. NFDUMP = dump.o dmpnote.o dmpresp.o check.o recsio.o note.o resp.o \
  86. lrsp.o startup.o misc.o miscio.o pageout.o gname.o perms.o \
  87. permit.o gtime.o cursor.o strcasecmp.o
  88. NFLOAD = loadvars.o loadnf.o buildnf.o recsio.o gname.o gtime.o \
  89. startup.o misc.o miscio.o cursor.o loadem.o parse.o acssort.o \
  90. check.o perms.o permit.o note.o ldmisc.o find.o resp.o \
  91. lrsp.o datein.o getdate.o ftime.o strcasecmp.o
  92. all bin: libnfcom.a user network utility
  93. @echo notesfile binaries up-to-date
  94. clean:
  95. rm -f *.o $(CMDS) libnfcom.a
  96. # DO NOT remove "spool".
  97. rm -f print
  98. rm -f Make.errs
  99. sizes:
  100. size $(CMDS)
  101. help:
  102. @echo type make base as su to make notes directories.
  103. @echo type make boot to compile and install everything.
  104. @echo type make install to compile and install code and man pages.
  105. @echo type make bin to merely make binaries.
  106. @echo for more info, see the Notesfile Reference Manual.
  107. @echo a good first time sequence is make base then make boot.
  108. user:
  109. make -f Makefile.user CFLAGS="${CCFLAGS}" LFLAGS="${LFLAGS}" \
  110. TERMCAP="${TERMCAP}" $(USERCMDS)
  111. network:
  112. make -f Makefile.net CFLAGS="${CCFLAGS}" LFLAGS="${LFLAGS}" \
  113. TERMCAP="${TERMCAP}" $(NETCMDS)
  114. utility:
  115. make -f Makefile.util CFLAGS="${CCFLAGS}" LFLAGS="${LFLAGS}" \
  116. TERMCAP="${TERMCAP}" $(UTILCMDS)
  117. # make base should only be run once!
  118. # This set of commands sets up the required files down in the
  119. # binary directories. It's main purpose is to do the several
  120. # installation commands that might just have to be super-user.
  121. base:
  122. -mkdir $(MSTDIR) $(ARCHDIR)
  123. -chown $(NOTES) $(MSTDIR) $(ARCHDIR)
  124. -chgrp $(NOTESGRP) $(MSTDIR) $(ARCHDIR)
  125. (cd $(BIN); touch notes nfprint nfstats checknotes nfpipe)
  126. -(cd $(BIN); chown $(NOTES) notes nfprint nfstats nfpipe checknotes)
  127. -(cd $(BIN); chgrp $(NOTESGRP) notes nfprint nfstats nfpipe checknotes)
  128. # establish "aliases" for auto-sequencing entry points
  129. # make more links with other names if you want them.
  130. - ln -s $(BIN)/notes $(BIN)/$(AUTOSEQ)
  131. -(cd $(NET); touch nfxmit nfrcv)
  132. -(cd $(NET); chown $(NOTES) nfxmit nfrcv)
  133. -(cd $(NET); chgrp $(NOTESGRP) nfxmit nfrcv)
  134. touch $(LIBDIR)/libnfcom.a
  135. -chown $(NOTES) $(LIBDIR)/libnfcom.a
  136. -chgrp $(NOTESGRP) $(LIBDIR)/libnfcom.a
  137. @echo base generation done
  138. boot: spool $(UNIQID) placelib bin install
  139. # make the nfgripes file and open it
  140. -./mknf -o nfgripes
  141. -./mknf -on nfmaint
  142. @echo notesfile system booted
  143. spool:
  144. -mkdir $(UTILITY) $(SEQUENCER) $(LOCKS) $(ALIASES)
  145. -chown $(NOTES) $(UTILITY) $(SEQUENCER) $(LOCKS) $(ALIASES)
  146. -chgrp $(NOTESGRP) $(UTILITY) $(SEQUENCER) $(LOCKS) $(ALIASES)
  147. chmod 775 $(MSTDIR) $(UTILITY) $(SEQUENCER) $(LOCKS) $(ALIASES)
  148. -mkdir $(UTILITY)/coredump
  149. chmod 777 $(UTILITY)/coredump
  150. -chown $(NOTES) $(UTILITY)/coredump
  151. -chgrp $(NOTESGRP) $(UTILITY)/coredump
  152. # generate the available notesfile file here - only once!
  153. echo "available notesfiles" > $(UTILITY)/avail.notes
  154. cp moderators $(UTILITY)/moderators
  155. touch $(UTILITY)/Dflt-Seq
  156. -chown $(NOTES) $(UTILITY)/moderators $(UTILITY)/avail.notes $(UTILITY)/Dflt-Seq
  157. -chgrp $(NOTESGRP) $(UTILITY)/moderators $(UTILITY)/avail.notes $(UTILITY)/Dflt-Seq
  158. chmod 664 $(UTILITY)/avail.notes $(UTILITY)/Dflt-Seq
  159. @echo Notesfile Spool directories ready
  160. $(UNIQID):
  161. echo 1 > $(UNIQID)
  162. chmod 660 $(UNIQID)
  163. -chown $(NOTES) $(UNIQID)
  164. -chgrp $(NOTESGRP) $(UNIQID)
  165. # make sure that all the appropriate directories exist
  166. dirs: $(MSTDIR) $(ARCHDIR) $(UTILITY) $(SEQUENCER) $(LOCKS) \
  167. $(ALIASES) $(UTILITY)/coredump
  168. $(MSTDIR) $(ARCHDIR) $(UTILITY) $(SEQUENCER) $(LOCKS) $(ALIASES):
  169. -mkdir $@
  170. -chown $(NOTES) $@
  171. -chgrp $(NOTESGRP) $@
  172. chmod 775 $@
  173. $(UTILITY)/coredump:
  174. -mkdir $@
  175. -chown $(NOTES) $@
  176. -chgrp $(NOTESGRP) $@
  177. chmod 777 $@
  178. install: dirs $(UNIQID) placedoc placelib
  179. make -f Makefile.user NOTES="${NOTES}" NOTESGRP="${NOTESGRP}" \
  180. BIN="${BIN}" install
  181. make -f Makefile.util NOTES="${NOTES}" NOTESGRP="${NOTESGRP}" \
  182. UTILITY="${UTILITY}" install
  183. make -f Makefile.net NOTES="${NOTES}" NOTESGRP="${NOTESGRP}" \
  184. NET="${NET}" UTILITY="${UTILITY}" install
  185. @echo notesfiles installed
  186. placedoc: $(HLPFILES)
  187. cp $? $(UTILITY)
  188. -(cd $(UTILITY); chmod 644 $?)
  189. -(cd $(UTILITY); chown $(NOTES) $?; chgrp $(NOTESGRP) $?)
  190. @echo notesfile help files installed
  191. placelib: libnfcom.a
  192. cp libnfcom.a $(LIBDIR)/libnfcom.a
  193. -ranlib $(LIBDIR)/libnfcom.a
  194. #
  195. # Save old binaries. Put them all in the utility directory
  196. # so we don't clutter the bin directories
  197. #
  198. save: saveuser savenet saveutil
  199. saveuser:
  200. cp $(BIN)/notes $(UTILITY)/notes.old
  201. cp $(BIN)/nfpipe $(UTILITY)/nfpipe.old
  202. cp $(BIN)/nfprint $(UTILITY)/nfprint.old
  203. cp $(BIN)/nfstats $(UTILITY)/nfstats.old
  204. cp $(BIN)/checknotes $(UTILITY)/checknotes.old
  205. savenet:
  206. cp $(NET)/nfxmit $(UTILITY)/nfxmit.old
  207. cp $(NET)/nfrcv $(UTILITY)/nfrcv.old
  208. cp $(UTILITY)/newsinput $(UTILITY)/newsinput.old
  209. cp $(UTILITY)/newsoutput $(UTILITY)/newsoutput.old
  210. saveutil:
  211. cp $(UTILITY)/mknf $(UTILITY)/mknf.old
  212. cp $(UTILITY)/rmnf $(UTILITY)/rmnf.old
  213. cp $(UTILITY)/nfarchive $(UTILITY)/nfarchive.old
  214. cp $(UTILITY)/nfmail $(UTILITY)/nfmail.old
  215. #
  216. # User subroutines
  217. #
  218. libnfcom.a: $(LIBOBJS)
  219. ar r libnfcom.a $(LIBOBJS)
  220. -ranlib libnfcom.a
  221. #
  222. # Load/Dump tools
  223. #
  224. nfdump: nfdump.o $(NFDUMP) libnfcom.a
  225. @echo loading nfdump
  226. @$(CC) -o nfdump nfdump.o $(NFDUMP) libnfcom.a $(TERMCAP)
  227. nfload: nfload.o $(NFLOAD) libnfcom.a
  228. @echo loading nfload
  229. @$(CC) -o nfload nfload.o $(NFLOAD) libnfcom.a $(TERMCAP)
  230. #
  231. # this is to make updating the "release" copy easy.
  232. #
  233. dist: $(CFILES) $(HFILES) $(HLPFILES) $(MISCFILES) Revisions
  234. ${DCP} $? $(DISTDIR)/src/.
  235. Revisions: $(CFILES) $(HFILES) $(MISCFILES)
  236. grep "Header:" $(CFILES) $(HFILES) $(MISCFILES) > Revisions
  237. #
  238. # Update the RCS library with this command.
  239. # Puts modified files into the RCS libraries with
  240. # the version number specified by "RCSID".
  241. # Also uses the RCS[IO]FLAGS variables.
  242. #
  243. # since RCS has a bug in that the -l flag does no update the
  244. # version number in the copy left available, we check in
  245. # the files and then check them out again.
  246. #
  247. freeze: $(CFILES) $(HFILES) $(MISCFILES) $(HLPFILES)
  248. ci $(RCSIFLAGS) $?
  249. co $(RCSOFLAGS) $?
  250. # Make printouts of the modified routines
  251. #
  252. print: $(MISCFILES) $(HFILES) $(CFILES) $(HLPFILES)
  253. # pr -f $? | lpr -b "Notesfile Code"
  254. imprint -2 -I -P2 $?
  255. # For those using vi, produce a ctags file of the source code.
  256. #
  257. tags: $(CFILES)
  258. ctags $(CFILES)
  259. #
  260. # Lint the mess to catch inconsistencies.
  261. #
  262. lint:
  263. lint -haxc $(CFLAGS) *.c