www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/12/19/22:28:13

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Date: Wed, 19 Dec 2001 22:25:08 -0500
Message-Id: <200112200325.fBK3P8528329@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <809aeb88.0112171814.317a55ad@posting.google.com>
(big10p AT hotmail DOT com)
Subject: Re: Should I use bash as default shell in makefiles?
References: <809aeb88 DOT 0112171814 DOT 317a55ad AT posting DOT google DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

http://www.delorie.com/djgpp/doc/ug/larger/makefiles.html

http://www.delorie.com/gnu/docs/make/make_toc.html

You shouldn't need to worry about the shell until you get into more
complex Makefiles.  I suggest avoiding that until you get the hang of
simple Makefiles.  DJGPP's make is quite capable of supporting the
command.com syntax as well as emulating a number of simpler shell-isms
internally.  But, the commands you use in a Makefile should be no
different than the ones you'd use in a batch file.  Make's job is
primarily to decide *which* commands to run, not to make the commands
more complex.

http://www.delorie.com/gnu/docs/make/make_16.html talks about
automatic dependency generation, but that's more robust (and complex)
than most need.  For simple DJGPP Makefiles, just add -MMD to your gcc
options, and put this at the end of your Makefile:

DEPS=$(wildcard *.d)
ifneq ($(DEPS),)
include $(DEPS)
endif

And it's best to be simple anyway :-)

You're not at a disadvantage by not knowing unix (well, posix).  There
are a few traditional things (like using dashes for command-line
options, and that they preceed other non-options) but you'll pick
those up quickly enough.

- Raw text -


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