www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/12/20/12:18:59

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: big10p AT hotmail DOT com (Chris Chadwick)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Should I use bash as default shell in makefiles?
Date: 20 Dec 2001 09:08:48 -0800
Organization: http://groups.google.com/
Lines: 42
Message-ID: <809aeb88.0112200908.59cd0b1f@posting.google.com>
References: <809aeb88 DOT 0112171814 DOT 317a55ad AT posting DOT google DOT com> <200112200325 DOT fBK3P8528329 AT envy DOT delorie DOT com>
NNTP-Posting-Host: 195.92.198.72
X-Trace: posting.google.com 1008868129 758 127.0.0.1 (20 Dec 2001 17:08:49 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: 20 Dec 2001 17:08:49 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

DJ Delorie <dj AT delorie DOT com> wrote in message news:<200112200325 DOT fBK3P8528329 AT envy DOT 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.

The main reason I was thinking I'd have to use an alternative shell to
command.com, was because of this example from the make docs:

%.d: %.c
        $(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \
              | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
              [ -s $@ ] || rm -f $@'

Phew! I think I'll use the method you describe for dependencies,
instead ;)
Thanks for your help.

- Raw text -


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