Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 May 1998 21:59:48 -0700
From:      Studded <Studded@dal.net>
To:        FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Generic makefile question
Message-ID:  <355685C4.D52B88B0@dal.net>

next in thread | raw e-mail | index | archive | help
This isn't related specifically to FreeBSD but I figured someone here
would know. :)  I am working on cleaning up a makefile (for our ircd)
and I've run into a problem. Here are (what I hope are) the relevant
bits:

SHELL=/bin/sh
ALLSUBDIRS=doc include src
RM=rm
RMARGS=-f
THINGSTOCLEAN=*~ \#* *.orig *.rej *.o *pure* ircd version.c chkconf core

clean:
        $(RM) $(RMARGS) $(THINGSTOCLEAN)
        @for i in $(ALLSUBDIRS); do \
                echo "Cleaning $$i";\
               ( cd $$i; ${RM} ${RMARGS} *~ \#* *.orig *.rej *.o *pure*
              ircd version.c chkconf core ; ) \ (these two are one line)
        done
        -@if [ -f include/setup.h ] ; then \
          echo "To really restart installation, remove include/setup.h"
; \
        fi
        -@if [ -f include/options.h ] ; then \
          echo "and include/options.h" ; \
        fi

	Doing it this way it works just fine. However what I'd like to do is:

( cd $$i; ${RM} ${RMARGS} ${THINGSTOCLEAN}; ) \

When I do that, I get this:

 55$ make clean
rm -f *~ #* *.orig *.rej *.o *pure* ircd version.c chkconf core
Syntax error: end of file unexpected (expecting ")")
*** Error code 2

Stop.

Note that the first one with the same arguments works.

	I tried every combination I could think of using $(var), ${var},
spaces, semicolons, etc. The only thing that didn't give me that error
was:

( cd $$i; ${RM} ${RMARGS} "${THINGSTOCLEAN}"; ) \

However it apparently didn't expand the variable because nothing got
deleted.

	Any help would be appreciated, including pointers to on line tutorials.
Yes, I've read the man page about a thousand times now so if the
answer's there a quote would be a good thing. :)

Thanks,

Doug

-- 
***         Chief Operations Officer, DALnet IRC network       ***
*** Proud designer and maintainer of the world's largest Internet
***    Relay Chat server with 5,328 simultaneous connections.
*** Try spider.dal.net on ports 6662-4    (Powered by FreeBSD)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?355685C4.D52B88B0>