Makefile: replace buidling rules for executables with one rule using wildcards
1 files changed, 7 insertions(+), 22 deletions(-)

M Makefile
M Makefile +7 -22
@@ 3,19 3,22 @@ ASFLAGS = -f elf64
 
 all: swapwm mandelbrot mandelbrot-asm avx bootstrap2.o playground.o foxx mandelbrot-mt
 
-fox: fox.o bootstrap.o
-			$(LD) $(LDFLAGS) -o $@ $^
-
 %.o: %.asm
 			$(AS) $(ASFLAGS) -o $@ $^
 
-bootstrap2: bootstrap.o bootstrap2.o
+%: %.o 
+			$(LD) $(LDFLAGS) -o $@ $^
+
+fox: fox.o bootstrap.o
 			$(LD) $(LDFLAGS) -o $@ $^
 
 bootstrap2.o: fox 
 			cat system.fox fileio.fox elf64.fox \
 			bootstrap2.fox bye.fox | ./fox
 
+bootstrap2: bootstrap.o bootstrap2.o
+			$(LD) $(LDFLAGS) -o $@ $^
+
 swapwm-config.fox: 
 			cp swapwm-config.def.fox swapwm-config.fox
 

          
@@ 24,46 27,28 @@ swapwm.o: fox swapwm-config.fox
 			cat system.fox fileio.fox no-debug.fox elf64.fox \
 			bootstrap2.fox fileio.fox buf.fox swapwm-config.fox swapwm.fox bye.fox | ./fox
 
-swapwm: swapwm.o 
-			$(LD) $(LDFLAGS) -o $@ $^
-			
 mandelbrot.o: fox
 			cat system.fox fileio.fox elf64.fox \
 			bootstrap2.fox fileio.fox mandelbrot.fox bye.fox | ./fox
 
-mandelbrot: mandelbrot.o
-			$(LD) $(LDFLAGS) -o $@ $^
-
 mandelbrot-asm.o: fox
 			cat system.fox fileio.fox asm.fox elf64.fox \
 			bootstrap2.fox fileio.fox malloc.fox \
 			mandelbrot-asm.fox bye.fox | ./fox
 
-mandelbrot-asm: mandelbrot-asm.o
-			$(LD) $(LDFLAGS) -o $@ $^
-			
 mandelbrot-mt.o: fox
 			cat system.fox fileio.fox asm.fox elf64.fox \
 			bootstrap2.fox fileio.fox malloc.fox \
 			thread.fox mandelbrot-mt.fox bye.fox | ./fox
 
-mandelbrot-mt: mandelbrot-mt.o
-			$(LD) $(LDFLAGS) -o $@ $^
-			
 avx.o: fox
 			cat system.fox fileio.fox elf64.fox \
 			bootstrap2.fox avx.fox bye.fox | ./fox
 
-avx:		avx.o
-			$(LD) $(LDFLAGS) -o $@ $^
-
 foxx.o: fox
 			cat system.fox asm.fox fileio.fox elf64.fox \
 			bootstrap2.fox foxx.fox bye.fox | ./fox
 
-foxx:		foxx.o
-			$(LD) $(LDFLAGS) -o $@ $^
-
 clean:
 			rm -f *.o fox bootstrap2 swapwm mandelbrot avx \
 			mandelbrot-mt mandelbrot-asm mandelbrot foxx