4 DATA_SIZE = 8191 # the 5th Mersenne prime
5 DATA = data ordered-data
13 EXECS = bubble quicksort
17 all : $(EXECS) $(DATA)
20 $(RM) -f *.o $(EXECS) $(EXECS:%=%-scaling.*) $(DATA)
22 scaling : $(EXECS:%=%-scaling.dat)
26 %-scaling.dat : % scaling.py data.py
27 ./scaling.py --max-time 1 --repeats 3 --plot $(@:%.dat=%.png) ./$< > $@
30 ./$< $(DATA_SIZE) > $@
32 ordered-data : data.py
33 ./$< --ordered $(DATA_SIZE) > $@
35 $(EXECS:%=%.o) main.o : %.o : %.c sort.h
36 $(CC) -c $(CFLAGS) -o $@ $<
38 $(EXECS) : % : main.o %.o
39 $(LD) $(LDFLAGS) -o $@ $^
41 # Interesting Makefile sections
42 # 4.12.1 Syntax of Static Pattern Rules
43 # 6.3.1 Substitution References