Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Nov 2000 01:11:23 -0500 (EST)
From:      "Philip M. Gollucci" <gollucci@wam.umd.edu>
To:        FreeBSD questions <freebsd-questions@FreeBSD.ORG>
Subject:   for constructs on FreeBSD4.1-RELEAE &Solaris 5.7 in Makefiles
Message-ID:  <Pine.GSO.4.21.0011060102501.13626-100000@rac1.wam.umd.edu>

next in thread | raw e-mail | index | archive | help
On SunOS rac2.wam.umd.edu 5.7 Generic_106541-11 sun4u sparc SUNW,Ultra-60
how does one write a for loop in a Makefile given that the first line is
#!/bin/sh

I would think that its the same as FreeBSD's make, but apparently its not,
or am I missing something here ? I would wrap this at 80 chars, but I
didn't want to have to deal with putting extra slashes where I was sure
they could go.

ie.. my attempt follows

NUM_SECONDARIES = 1 2 3 4 

secondary: $(OBJS) main.o
        @$(CPP) $(CPPFLAGS) -o $(NAME)_$@ $(OBJS) main.o
        @echo "\n"
	@for i in $(NUM_SECONDARIES); \
	    do @echo "================ Test Driver $@$i Output ================\n";
        	-./$(NAME)_$@ < $(SIN)$i > $(MY_POUT); \
        	-$(DIFF) $(DIFFFLAGS) $(SOUT)$i $(MY_POUT); \
       		-$(DIFF) $(DIFFFLAGS) $(SLOG)$i $(MY_LOG); \
        	-$(TIME) ./$(NAME)_$@ < $(SIN)$i > $(MY_POUT); \
	 done
         @$(RM) $(NAME)_$@; \
	       
Yes, I read the man pages on make and for which I might add for once and
only once, solaris beat the hell out of FreeBSD's documentation for 'for'

*****************************************************************************
Philip M. Gollucci (p6m7g8)
Web-site    : http://www.p6m7g8.com
E-mail      : gollucci@wam.umd.edu 
	      Philip@p6m7g8.com 
Phone       : 301.249.6261 (Home)
	      301.314.3118 (College)
Major       : Computer Science 
	      Electrical Engineering 
Minor	    : Classical & Jazz Performance
Current Job : Science, Discovery, & the Universe Webmaster
	      URL: http://www.sdu.umd.edu 
Resume	    : http://www.wam.umd.edu/~gollucci/resume.html
*****************************************************************************




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?Pine.GSO.4.21.0011060102501.13626-100000>