From b77b122041551be03ea03ce1801d788218eb5067 Mon Sep 17 00:00:00 2001 From: dtb Date: Sat, 17 Sep 2022 00:31:52 -0400 Subject: [PATCH] independ nonzero(1) --- Makefile | 13 +++++++++---- nonzero/Makefile | 27 +++++++++++++++++++++++++++ {man => nonzero}/nonzero.1 | 0 {src => nonzero}/nonzero.c | 0 4 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 nonzero/Makefile rename {man => nonzero}/nonzero.1 (100%) rename {src => nonzero}/nonzero.c (100%) 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