home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.msdos.programmer
- Path: sparky!uunet!uunet.ca!geac!torag!zooid!ross
- From: Ross Ridge <ross@zooid.guild.org>
- Subject: Re: Summary: P.D. MAKE for msdos
- Organization: ZOOiD BBS
- Date: Sun, 16 Aug 1992 20:12:16 GMT
- Message-ID: <1992Aug16.201216.22059@zooid.guild.org>
- References: <1992Aug14.152501.17351@exu.ericsson.se> <XwNkPB3w165w@cybrspc.UUCP>
- Lines: 85
-
- roy%cybrspc@cs.umn.edu (Roy M. Silvernail) writes:
- >Now that you mention it.....
- >
- >I've got a library in progress, and I'm adding modules occasionally.
- >Since each module has to be tested before addition, the .obj is
- >natuarally not out of date against its .c file.
- >
- >So... how do I write rules that specify the .lib depend on the component
- >.obj's and force the recompilation of said .c files and their
- >addition/update into the lib? (they need to be recompiled to remove the
- >main() that lies inside an #ifdef TEST)
-
- The simple solution is not build the .obj file when testing modules
- and compile directly to .exe. Try something like this:
-
- #
- # Makefile
- #
- # By Ross Ridge
- # Public Domain
- # 92/06/01 07:44:09
- #
- # make the terminfo/termcap library
- #
- # @(#) mytinfo Makefile 3.6 92/06/01 public domain, By Ross Ridge
- #
-
- CC = bccx
- DFLAGS = -v
- CFLAGS = $(DFLAGS) -1 -A -d -f- -G- -H=mytinfo.sym -k- -ms -O -r -Z -X
-
- LDFLAGS = $(DFLAGS)
- DEBUG = -v
-
- AR = tlib
- ARFLAGS = /E /C
-
- OBJS1=addstr.obj binorder.obj buildpath.obj caplist.obj capsort.obj compar.obj
- OBJS2=fake_stdio.obj fillterm.obj findcap.obj findterm.obj getother.obj gettbin.obj
- OBJS3=gettcap.obj gettinfo.obj sprintf.obj tcapconv.obj tcapvars.obj termcap.obj
- OBJS4=terminfo.obj tgoto.obj tiget.obj tmatch.obj tparm.obj tputs.obj tty.obj version.obj
-
- # you may need this:
- #.SUFFIXES: .exe
-
- # works on Unix, but Borland's make is buggy...
- .c.exe:
- $(CC) -DTEST $(DEBUG) $(LDFLAGS) $(CFLAGS) $< -o$@
-
- .c.obj:
- $(CC) $(CFLAGS) -c $<
-
- mytinfo.lib: libcmd $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4)
- del mytinfo.lib
- $(AR) mytinfo.lib @libcmd
-
- test: tputs.exe tparm.exe readcaps.exe sprintf.exe
-
- libcmd: makefile
- echo $(ARFLAGS) & > libcmd
- for %i in ($(OBJS1)) do echo + %i & >> libcmd
- for %i in ($(OBJS2)) do echo + %i & >> libcmd
- for %i in ($(OBJS3)) do echo + %i & >> libcmd
- for %i in ($(OBJS4)) do echo + %i & >> libcmd
- echo , >> libcmd
-
- tputs.exe: tputs.c term.h $(DEFS_H)
-
- tparm.exe: tparm.c term.h $(DEFS_H)
-
- readcaps.exe: readcaps.c $(DEFS_H)
-
- sprintf.exe: sprintf.c $(DEFS_H)
-
-
- You'ld type "make" to build the library, and "make test" to build the
- test excutable.s
-
- Ross Ridge
-
- --
- Ross Ridge - The Great HTMU l/ //
- [OO][oo]
- ross@zooid.guild.org /()\/()/
- uunet.ca!zooid!ross db //
-