peter@baylor.UUCP (Peter da Silva) (08/15/85)
I tried using the following makefile fragment with the make program posted to the net recently. The routine that reads targets put both *.obj dependencies in the sam place, with the result that when it found "file.asm", it tried to call the c compiler AND the assembler. The changes that follow allow you to have more than one dependency target in the default rules, and it tries to make each target in turn until it gets one. This change breaks multiple sets of dependencies for a given explicit target, but it should be easy enough to fix that so it only allows multiple different targets of the form "*.ext". I don't use this feature, and don't thing the program supports it properly anyway, so I didn't worry about it. There was also a peice of debugging code not bracketed by "#ifdef DEBUG", and I made that change as well. # dependency data for lattice c *.obj : *.c lc1 $* -dLATTICE -ia lc2 $* *.exe : *.obj link a:c+$*,$*,,a:lc *.obj : *.asm asm $*; *.com : *.obj link a:cc+$*,$*,,a:lc exe2bin $* ren $*.bin $*.com+++ ----------- 40a41,53 > * 2.13 Allowed the use of multiple default rules for a given > * default target, enforced the requirement of a single > * instance of a given explicit target: > * *.obj : *.asm > * asm $*; > * *.obj : *.c > * cc $* -ia > * is legal, but: > * foo.obj: bar.asm > * asm bar,foo; > * foo.obj: bar.c > * cc bar -ia -ofoo > * is not (and not terribly useful or interesting). 425d437 < if (strcmp (targ->file->fname, name) == 0) return targ; 644a657 > #ifdef DEBUG 645a659 > #endif 720c734 < if (!worked) {free(cname); goto ret0;} --- > if(!worked) {free(cname); continue;} /* If this one didn't work, try the next one PDS */ 758c772 < printf ("Building \"%s\"\n", targ->file->fname); --- > printf ("Building \"%s : %s...\"\n", targ->file->fname, targ->PreqList->file->fname); -- Peter da Silva (the mad Australian) UUCP: ...!shell!neuro1!{hyd-ptd,baylor,datafac}!peter MCI: PDASILVA; CIS: 70216,1076