www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/02/16:09:55

Xref: news-dnh.mv.net comp.os.msdos.djgpp:4085
Path: news-dnh.mv.net!mv!news.sprintlink.net!cs.utexas.edu!news.ti.com!sislnews.csc.ti.com!usenet
From: Ed DOT Mueller AT itg DOT ti DOT com (Ed. Mueller)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Sample Makefile
Date: 2 Jan 1996 19:27:25 GMT
Organization: Texas Instruments
Lines: 41
Message-ID: <4cc0ut$2u5@superb.csc.ti.com>
References: <951220223650_95924759 AT emout05 DOT mail DOT aol DOT com>
NNTP-Posting-Host: ebm.dseg.ti.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <951220223650_95924759 AT emout05 DOT mail DOT aol DOT com>, NMair AT aol DOT com says...
>
>Can someone out there in internet land send me a simple sample  makefile.
>I have gmake from simtel but no example makefiles were included.

This type of makefile that I use seems to work OK for me.  It handles all
the auto-dependencies fairly well.  You'll need a copy of SED though (should
be one on Simtel).

#		*Translator Definitions*
# -g for debug info, -Wall for all warning messages
CPPFLAGS = -g -Wall
CC = gcc

#		*Implicit Rules*
%.o : %.cpp
	$(CC) -c $(CPPFLAGS) $<
%.d : %.cpp
	command /c $(CC) -MM $< | sed "s/$*.o/& $@/g" > $@

#		*List Macros*
SOURCES = testcras.cpp crashsh.cpp
OBJS = testcras.o crashsh.o
EXEC = testcras

#		*Explicit Rules*
testcras: $(OBJS)
	$(CC) $(CPPFLAGS) -o $(EXEC) ${OBJS} -lgpp -lpc -lm

clean:
	del *.o

include $(SOURCES:.cpp=.d)


--
Ed. Mueller         The opinions expressed do not reflect my employer.
Ed DOT Mueller AT itg DOT ti DOT com
Texas Instruments Information Systems & Services Group
Plano, TX.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019