On Tue, 2005-05-10 at 23:15 +0100, haynes george wrote: > ALL = prog1 prog2 prog3 prog4 prog5 > > LOCK_DIR = /var/lock/test > ECHO = /bin/echo > BIN_DIR = /home/bin > TMP_FILE = /home/temp/tmp.file > JOB = start > > > $(ALL) : $(SUBSYS_FILE_DIR)/$@
This defines five rules (one each for prog1, prog2, ...) in the form: prog1: $(SUBSYS_FILE_DIR)/prog1 etc. Note, however, that this was not done with GNU Make because GNU Make does not allow $@ in the prereq list (it does allow $$@ for SysV compatibility). > @$(ECHO) "Begin \"$(JOB) [EMAIL PROTECTED]" > $(TMP_FILE) This writes a string to $(TMP_FILE) so for prog1 /home/temp/tmp.file gets the line Begin "start prog1" written to it. > @$(BIN_DIR)/$@ $(JOB) >> $(TMP_FILE) 2>&1 This then runs $(BIN_DIR)/prog1 (or prog2, ...) and appends the output to the temporary file mapping handle 2 to 1 (i.e. errors go into the file as well). > @$(ECHO) "End \"$(JOB) [EMAIL PROTECTED]" >> $(TMP_FILE) And this appends End "start prog1" or similar to the temporary file. > prog1 : prog2 prog3 > prog3 : prog4 > prog4 > prog5 : prog4 prog1 And these are just dependencies between the various programs. John. -- John Graham-Cumming Home: http://www.jgc.org/ Work: http://www.electric-cloud.com/ POPFile: http://getpopfile.org/ GNU Make Standard Library: http://gmsl.sf.net/ _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
