diff --git a/Makefile b/Makefile index e3d2ace..1179d44 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ cleanprograms: $(RM) bin/lt $(RM) bin/mm $(RM) bin/multiply - $(RM) bin/nonzero + $(MAKE) -C nonzero clean $(RM) bin/pscat $(RM) bin/rot13 $(MAKE) -C rot13 clean @@ -90,8 +90,13 @@ levenshtein: src/levenshtein.c lowercase: sysexits src/lowercase.c $(CC) $(CFLAGS) -o bin/lowercase src/lowercase.c -nonzero: src/nonzero.c - $(CC) $(CFLAGS) -o bin/nonzero src/nonzero.c +nonzero: bin/nonzero + +bin/nonzero: nonzero/nonzero + cp nonzero/nonzero bin/nonzero + +nonzero/nonzero: nonzero/Makefile nonzero/nonzero.c + $(MAKE) -C nonzero sane nutshell.o: libio usefulmacros src/nutshell.c src/nutshell.h src/nutshell_builtins.c $(CC) $(CFLAGS) -c -o build/nutshell.o src/nutshell.c @@ -302,4 +307,4 @@ unscii-user: curl "http://viznut.fi/unscii/unscii-16-full.pcf" >"~/.fonts/unscii-16-full.pcf" curl "http://viznut.fi/unscii/unscii-16-full.ttf" >"~/.fonts/unscii-16-full.ttf" -.PHONY: all clean cleanlibraries cleanprograms echo pscat roll rot13 stdbool str sysexits usefulmacros +.PHONY: all clean cleanlibraries cleanprograms echo nonzero pscat roll rot13 stdbool str sysexits usefulmacros diff --git a/nonzero/Makefile b/nonzero/Makefile new file mode 100644 index 0000000..26d2148 --- /dev/null +++ b/nonzero/Makefile @@ -0,0 +1,27 @@ +all: nonzero + +clean: + rm -rf ../dist/nonzero ../dist/nonzero.tar ../dist/nonzero.tar.gz nonzero + +dist: ../dist/nonzero.tar.gz + +sane: nonzero + +nonzero: nonzero.c + $(CC) -o nonzero nonzero.c + +../dist/nonzero: nonzero + mkdir -p ../dist/nonzero.tmp/bin/ ../dist/nonzero.tmp/share/man/man1/ + cp nonzero ../dist/nonzero.tmp/bin/nonzero + cp nonzero.1 ../dist/nonzero.tmp/share/man/man1/nonzero.1 + mv ../dist/nonzero.tmp ../dist/nonzero + +../dist/nonzero.tar: ../dist/nonzero + cd ../dist/nonzero && pax -w -x ustar . >../nonzero.tar.tmp + mv ../dist/nonzero.tar.tmp ../dist/nonzero.tar + +../dist/nonzero.tar.gz: ../dist/nonzero.tar + gzip -c <../dist/nonzero.tar >../dist/nonzero.tar.gz.tmp + mv ../dist/nonzero.tar.gz.tmp ../dist/nonzero.tar.gz + +.PHONY: all clean sane diff --git a/man/nonzero.1 b/nonzero/nonzero.1 similarity index 100% rename from man/nonzero.1 rename to nonzero/nonzero.1 diff --git a/src/nonzero.c b/nonzero/nonzero.c similarity index 100% rename from src/nonzero.c rename to nonzero/nonzero.c