home *** CD-ROM | disk | FTP | other *** search
- # @(#)Makefile.
- #
- # Makefile (a Makefile template)
- #
- # PROGRAM(s) :
- #
- # LIBRARY(s) :
- #
- # DATE :
- #
- # AUTHOR : W.Hatch
- #
- # PROJECT : WEH Software
- #
- # COMPANY : Coleman Research
- # 14504 Greenview Drive Suite 500
- # Laurel, Maryland 20708
- # Phone (301)470-3839
- # FAX (301)776-5461
- #
- #
- # This Makefile template assumes that the following shell scripts
- # are installed in one of the user's PATH directories
- #
- # sccs_admin arg1 arg2 ...
- # sccs_get arg1 arg2 ...
- # sccs_delta arg1 arg2 ...
- # sccs_edit arg1 arg2 ...
- # sccs_install arg1 arg2 ..
- #
- # where arg1 arg2 .... are the names of SRC, SCRIPT and HEADERS
- # files on which the sccs operations will be performed.
- #
- # These scripts are used to "hide" the differences between System V.3
- # and BSD 4.3 SCCS utility interfaces.
- #--------------------------------------------------------------------------
-
- #--------------------------------------------------------------------------
- # 1. define symbolic constants
- #
- # root directory for this activity
- ROOT=/usr/local
- #
- # relocatable library directory
- LIBDIR=$(ROOT)/lib
- #
- # target directory for executables
- BIN=$(ROOT)/bin
- #
- # documentation target directory
- MAN=$(ROOT)/man
- MAN1=$(MAN)/man1
- MAN3=$(MAN)/man3
- #
- # target directory for header files
- INCLUDE=$(ROOT)/include
- #
- # list of relocatable libraries required in link step
- LIBS=$(ROOT)/lib/libdbug.a \
- /usr/local/lib/gcc-gnulib /lib/libm.a
- #
- # list of header files, subject to change, on which *.o depend
- HEADERS=
- #
- # list of source files to be compiled
- SRC=
- #
- # list of object files to be linked
- OBJ=
- #
- # compile options
- CC=cc
- #CC=gcc
- AS=/bin/as
- #LD=/bin/ld /lib/crt0.o
- #LD=gcc
- LD=/bin/ld
- AR=/bin/ar
- GCFLAGS=-W -Wunused -Wcomment -Wshadow -c -g -I$(INCLUDE) -B/usr/local/lib/gcc-
- CFLAGS=-g -I$(INCLUDE) -I./ -DM_XENIX
- #
- # link/load flags
- LFLAGS=
- #
- # executable file to be created (assume only 1)
- EXE=
- #
- # list of shell script files maintained with this makefile
- SCRIPT=
- #
- # list of manual pages
- MANPAGES=
- #
- # list of all junk files that might occur in this directory
- JUNK=core a.out JOURNAL LINT paste.txt error.log dbg_jnl* CHECK CCHK CFLOW \
- MCCABE KDSI *PRINT GLINT CXREF TJ *.s tr.*
-
- #pretty_printer= *** YOUR FAVORITE PRETTY PRINTER *****
- #--------------------------------------------------------------------------
- # 2. link and load to create the executable
- #--------------------------------------------------------------------------
- $(EXE): $(OBJ) $(LIBS)
- $(CC) -o $(EXE) $(OBJ) $(LIBS)
-
- #--------------------------------------------------------------------------
- # 3. install all objects of this make
- #--------------------------------------------------------------------------
- install: $(EXE) $(SCRIPT)
- strip $(EXE)
- for i in $(EXE) $(SCRIPT); do \
- chmod ugo+x $$i; \
- cp $$i $(BIN); \
- done
- rm $(EXE)
-
- #--------------------------------------------------------------------------
- # 4. lint for syntax check on all C source, headers
- #--------------------------------------------------------------------------
- LINT: $(SRC) $(HEADERS)
- lint -DM_XENIX -I./ -I$(INCLUDE) $(SRC) >LINT 2>LINT2
- cat LINT2 >> LINT
- rm LINT2
-
- GLINT: $(SRC) $(HEADERS)
- gcc $(GCFLAGS) $(SRC) >GLINT 2>GLINT2
- cat GLINT2 >> GLINT
- rm -f GLINT2
- #--------------------------------------------------------------------------
- # 5. tidy up by getting rid of all junk files
- #--------------------------------------------------------------------------
- tidy:
- rm -f $(JUNK)
-
- #--------------------------------------------------------------------------
- # 6. clean up by removing all vestiges of previous makes
- #--------------------------------------------------------------------------
- clean: tidy admin delta
- rm -f $(EXE)
- rm -f *.o *.s
-
- #--------------------------------------------------------------------------
- # 7. uninstall all installed targets of this make
- # (remove any installed manual pages also)
- #--------------------------------------------------------------------------
- uninstall: clean
- for i in $(EXE) $(SCRIPT); do; \
- rm -f $(BIN)/$$i; \
- done
- for i in $(MANPAGES); do; \
- rm -f $(MAN1)/$$i; \
- done
-
- #--------------------------------------------------------------------------
- # 8. individual dependencies for C source files as per the following
- # example:
- #
- # foobar.c: SCCS/s.foobar.c
- # sccs_get foobar.c
- #
- #--------------------------------------------------------------------------
-
- #--------------------------------------------------------------------------
- # 9. individual dependencies for relocatable object files as per
- # the following example:
- #
- # foobar.o: foobar.c $(HEADERS)
- # cc -O -c foobar.c
- #
- #--------------------------------------------------------------------------
- #.c.o:
- # $(CC) $(CFLAGS) -c -S $<
- # $(AS) $*.s
-
- $(SRC) $(HEADERS):
- sccs_install $(SRC) $(HEADERS)
-
- #--------------------------------------------------------------------------
- # 10. individual dependencies for shell script and on line documentation
- # as per the following example:
- #
- # textfile: SCCS/s.textfile
- # sccs_get textfile
- #
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- # 11. initialize SCCS administration of the source files
- #--------------------------------------------------------------------------
- admin:
- sccs_admin $(SRC) $(HEADERS) $(SCRIPT) $(MANPAGES)
-
-
- #--------------------------------------------------------------------------
- # 12. edit - get all of the source files ready to edit
- #--------------------------------------------------------------------------
- edit:
- sccs_edit $(SRC) $(SCRIPT) $(HEADERS) $(MANPAGES)
-
- #--------------------------------------------------------------------------
- # 13. get - get all of source files in read only form
- #--------------------------------------------------------------------------
- get:
- sccs_get $(SRC) $(SCRIPT) $(HEADERS) $(MANPAGES)
-
- #--------------------------------------------------------------------------
- # 14. delta - SCCS delta all source
- #--------------------------------------------------------------------------
- delta:
- sccs_delta $(SRC) $(SCRIPT) $(HEADERS) $(MANPAGES)
-
- #--------------------------------------------------------------------------
- # 14. print all source files
- #--------------------------------------------------------------------------
- print: $(SRC) $(HEADERS) LINT CFLOW CXREF
- ${pretty_printer} CFLOW $(HEADERS) $(SRC) Makefile CXREF LINT
-
- #--------------------------------------------------------------------------
- # 16. manual page installation
- # copy manual pages to $(MAN1) and $(MAN3)
- #--------------------------------------------------------------------------
- manual: $(MANPAGES)
- cp $(MANPAGES) $(MAN1)
-
- #--------------------------------------------------------------------------
- # 18. static analysis of code
- #--------------------------------------------------------------------------
- CFLOW: $(SRC) $(HEADERS)
- cflow -I$(INCLUDE) -I./ -ix $(SRC) >CFLOW
-
- CXREF: $(SRC) $(HEADERS)
- cxref -I$(INCLUDE) -I./ -DM_XENIX $(SRC) >CXREF
-
-