SMOLHERSHEY = smolhersheyexample smolhersheyhpgl smolhersheymin smolhersheyspecimen
smolhershey-all: $(SMOLHERSHEY)
clean:
	$(RM) $(SMOLHERSHEY) smolhershey.o $(foreach executable,$(SMOLHERSHEY),$(executable).o)
SMOLVERSION = 1.0
SMOLDEST = smolhershey-$(SMOLVERSION)
smolhershey-tarball:
	$(RM) -r $(SMOLDEST)
	-mkdir $(SMOLDEST)
	cp $(foreach executable,$(SMOLHERSHEY),$(executable).c) smolhershey.[ch] smolhersheyhpgl.png smolhershey-ps.png triplex.png ampersand.?.png imlac-pds-1-ssvchr.22.jhf smolhershey-imlac.png $(SMOLDEST)
	cp smolhershey.md $(SMOLDEST)/README.md
	cp smolhershey.mk $(SMOLDEST)/Makefile
	tar czvf $(SMOLDEST).tar.gz $(SMOLDEST)

smolhershey.o: smolhershey.h smolhershey.c
smolhersheyexample.o: smolhershey.h smolhersheyexample.c
smolhersheyhpgl.o: smolhershey.h smolhersheyhpgl.c
smolhersheymin.o: smolhershey.h smolhersheymin.c
smolhersheyspecimen.o: smolhershey.h smolhersheyspecimen.c
smolhersheyexample: smolhersheyexample.o smolhershey.o
	$(CC) $(LDFLAGS) $^ -o $@
smolhersheyhpgl: smolhersheyhpgl.o smolhershey.o
	$(CC) $(LDFLAGS) $^ -o $@ -lm
smolhersheymin: smolhersheymin.o smolhershey.o
	$(CC) $(LDFLAGS) $^ -o $@ -lm
smolhersheyspecimen: smolhersheyspecimen.o smolhershey.o
	$(CC) $(LDFLAGS) $^ -o $@ -lm

