28 lines
434 B
Makefile
28 lines
434 B
Makefile
|
all: main pdfs dots
|
||
|
|
||
|
main: main.c libtrees.a
|
||
|
gcc $^ -o $@
|
||
|
|
||
|
part2: part2.c libtrees.a
|
||
|
gcc $^ -o $@
|
||
|
|
||
|
%.o: %.c
|
||
|
gcc -c $^ -o $@
|
||
|
|
||
|
lib%.a: %.o
|
||
|
ar rcs $@ $^
|
||
|
|
||
|
pdfs: $(patsubst %.txt,%.pdf,$(shell ls samples/*.txt))
|
||
|
dots: $(patsubst %.txt,%.dot,$(shell ls samples/*.txt))
|
||
|
|
||
|
samples/%.pdf: samples/%.dot
|
||
|
dot -Tpdf $< -o $@
|
||
|
|
||
|
samples/%.dot: samples/%.txt part2
|
||
|
./part2 $<
|
||
|
|
||
|
.PHONY: clean
|
||
|
|
||
|
clean:
|
||
|
rm -r lib*.a *.o samples/*.dot samples/*.pdf
|