target = ichijou

all: $(target)

$(target): ichijou.c
	gcc -Wall -ansi -pedantic $< -o $@

test: test_c test_pl

test_c: $(target)
	perl ichijou_unittest.pl

test_pl: ichijou.c
	perl ichijou_unittest2.pl $<

clean:
	$(MAKE) -C template clean
	-rm -f $(target) *.o

backup:
	$(MAKE) -C template backup
	-rm -f backup.tar.gz
	tar cf backup.tar *.c *.pl *.sh *.txt Makefile makefile.w32
	gzip -9 backup.tar
