home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / programm / 3828 < prev    next >
Encoding:
Text File  |  1992-07-21  |  1.6 KB  |  57 lines

  1. Newsgroups: comp.unix.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!mips!sdd.hp.com!hpscdc!mun
  3. From: mun@corp.hp.com (Duane T. Mun)
  4. Subject: Re: MAKE Question - am I asking too much?
  5. Message-ID: <Brr54t.DzE@scd.hp.com>
  6. Keywords: MAKE HELP 
  7. Sender: news@scd.hp.com (News Account)
  8. Organization: Hewlett-Packard
  9. References: <drt.711704826@brolga>
  10. Date: Tue, 21 Jul 1992 18:38:52 GMT
  11. Lines: 44
  12.  
  13. In article <drt.711704826@brolga> drt@brolga.cc.uq.oz.au (David Taylor) writes:
  14. > We have a set of programs (C and C/SQL) being worked on by multiple
  15. > programmers. Usually each program has a "main()" source file and
  16. > several support modules with header files. These support modules are
  17. > shared accross most of the programs.
  18. > All the source is stored on a common area and access is controlled 
  19. > via RCS. I am trying to set up a common makefile that will:
  20. > - checkout any files that are needed to satisfy the make.
  21.  
  22. $(HDRS) $(SRCS):    # Check out sources and headers as needed
  23.     co $@
  24.  
  25. This isn't a perfect answer, but it seems to work.  You might want to
  26. try GNU Make, I think they have built in rules for RCS.
  27.  
  28. > - pre-compile the C/SQL files.
  29. > - compile the C files
  30.  
  31. test.o: dclgen.h    # set up dependancies
  32.  
  33. .SUFFIXES: .c .sc    # define suffix rules
  34.  
  35. .c.o:            # how to make .o from .c
  36.     $(CC) $(CFLAGS) -c $< $(INCDIRS)
  37.  
  38. .sc.o:             # how to make .o from .sc
  39.     $(CPP) -C -P $< > $*.cpp    # get dclgen stuff
  40.     $(ESQLC) $*.cpp
  41.     $(CC) $(CFLAGS) -c $*.c $(INCDIRS)
  42.     rm -f $*.cpp $*.c
  43.  
  44. > - link the program.
  45.  
  46. test : $(OBJS)        # link
  47.     $(LD) $(LDFLAGS) -o $@ $? $(LIBDIRS) $(LIBS)
  48.  
  49. If you want to see the entire makefile, let me know.
  50.  
  51. Hope this helps.
  52.  
  53. --
  54.