# config_files = $(wildcard *.names)
config_files = core.names f77.names linpack.names # pchip.names sqpe.names

all: test s2d.h d2s.h

s2d.h: ./config $(config_files)
	./config -s2d $(config_files) > .tmp-$@
	mv .tmp-$@ $@

d2s.h: ./config $(config_files)
	./config -d2s $(config_files) > .tmp-$@
	mv .tmp-$@ $@

test: ./config
	@echo starting tests
	./config -s2d Test/in | diff Test/in-s2d -
	./config -d2s Test/in | diff Test/in-d2s -

config: config.sh
	cp $< $@
	chmod a+x $@

clean:
	rm -f s2d.h d2s.h config .tmp-*

realclean: clean
.PHONY: all test clean realclean
