home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / msdos / programm / 8563 < prev    next >
Encoding:
Text File  |  1992-08-16  |  2.6 KB  |  96 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!uunet.ca!geac!torag!zooid!ross
  3. From: Ross Ridge <ross@zooid.guild.org>
  4. Subject: Re: Summary: P.D. MAKE for msdos
  5. Organization: ZOOiD BBS
  6. Date: Sun, 16 Aug 1992 20:12:16 GMT
  7. Message-ID: <1992Aug16.201216.22059@zooid.guild.org>
  8. References: <1992Aug14.152501.17351@exu.ericsson.se> <XwNkPB3w165w@cybrspc.UUCP>
  9. Lines: 85
  10.  
  11. roy%cybrspc@cs.umn.edu (Roy M. Silvernail) writes:
  12. >Now that you mention it.....
  13. >
  14. >I've got a library in progress, and I'm adding modules occasionally.
  15. >Since each module has to be tested before addition, the .obj is
  16. >natuarally not out of date against its .c file.
  17. >
  18. >So... how do I write rules that specify the .lib depend on the component
  19. >.obj's and force the recompilation of said .c files and their
  20. >addition/update into the lib?  (they need to be recompiled to remove the
  21. >main() that lies inside an #ifdef TEST)
  22.  
  23. The simple solution is not build the .obj file when testing modules
  24. and compile directly to .exe.  Try something like this:
  25.  
  26. #
  27. # Makefile
  28. #
  29. # By Ross Ridge
  30. # Public Domain
  31. # 92/06/01 07:44:09
  32. #
  33. # make the terminfo/termcap library
  34. #
  35. # @(#) mytinfo Makefile 3.6 92/06/01 public domain, By Ross Ridge
  36. #
  37.  
  38. CC = bccx
  39. DFLAGS = -v 
  40. CFLAGS = $(DFLAGS) -1 -A -d -f- -G- -H=mytinfo.sym -k- -ms -O -r -Z -X 
  41.  
  42. LDFLAGS = $(DFLAGS)
  43. DEBUG = -v
  44.  
  45. AR = tlib
  46. ARFLAGS = /E /C
  47.  
  48. OBJS1=addstr.obj binorder.obj buildpath.obj caplist.obj capsort.obj compar.obj
  49. OBJS2=fake_stdio.obj fillterm.obj findcap.obj findterm.obj getother.obj gettbin.obj
  50. OBJS3=gettcap.obj gettinfo.obj sprintf.obj tcapconv.obj tcapvars.obj termcap.obj
  51. OBJS4=terminfo.obj tgoto.obj tiget.obj tmatch.obj tparm.obj tputs.obj tty.obj version.obj
  52.  
  53. # you may need this:
  54. #.SUFFIXES: .exe
  55.  
  56. # works on Unix, but Borland's make is buggy...
  57. .c.exe:
  58.         $(CC) -DTEST $(DEBUG) $(LDFLAGS) $(CFLAGS) $< -o$@
  59.  
  60. .c.obj:
  61.     $(CC) $(CFLAGS) -c $<
  62.  
  63. mytinfo.lib: libcmd $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4)
  64.     del mytinfo.lib
  65.     $(AR) mytinfo.lib @libcmd
  66.  
  67. test: tputs.exe tparm.exe readcaps.exe sprintf.exe
  68.  
  69. libcmd: makefile
  70.     echo $(ARFLAGS) & > libcmd
  71.     for %i in ($(OBJS1)) do echo + %i & >> libcmd
  72.     for %i in ($(OBJS2)) do echo + %i & >> libcmd
  73.     for %i in ($(OBJS3)) do echo + %i & >> libcmd
  74.     for %i in ($(OBJS4)) do echo + %i & >> libcmd
  75.     echo , >> libcmd
  76.  
  77. tputs.exe: tputs.c term.h $(DEFS_H)
  78.  
  79. tparm.exe: tparm.c term.h $(DEFS_H)
  80.  
  81. readcaps.exe: readcaps.c $(DEFS_H)
  82.  
  83. sprintf.exe: sprintf.c $(DEFS_H)
  84.  
  85.  
  86. You'ld type "make" to build the library, and "make test" to build the
  87. test excutable.s
  88.  
  89.                         Ross Ridge
  90.  
  91. -- 
  92. Ross Ridge - The Great HTMU                         l/     //
  93.                                     [OO][oo]
  94. ross@zooid.guild.org                            /()\/()/
  95. uunet.ca!zooid!ross                             db     //
  96.