From bf073593c888bde9860612bed80f70f90d55da82 Mon Sep 17 00:00:00 2001 From: dtb Date: Fri, 16 Sep 2022 10:56:10 -0400 Subject: [PATCH] independ echo --- Makefile | 12 +++++++----- echo/Makefile | 28 ++++++++++++++++++++++++++++ {man => echo}/echo.1 | 0 {src => echo}/echo.c | 0 4 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 echo/Makefile rename {man => echo}/echo.1 (100%) rename {src => echo}/echo.c (100%) diff --git a/Makefile b/Makefile index 95410c7..3f5ca87 100644 --- a/Makefile +++ b/Makefile @@ -66,11 +66,13 @@ calculate: libstr sysexits src/calculate.c $(CC) $(CFLAGS) -o src/calculate.o -c src/calculate.c $(CC) $(CFLAGS) -o bin/calculate lib/libstr.o src/calculate.o -echo.o: libio sysexits src/echo.c - $(CC) $(CFLAGS) -c -o build/echo.o src/echo.c +echo: bin/echo -echo: libio echo.o - $(CC) $(CFLAGS) -o bin/echo build/echo.o build/libio.o +bin/echo: echo/echo + mv echo/echo bin/echo + +echo/echo: echo/Makefile echo/echo.c + $(MAKE) -C echo sane false: src/false.c $(CC) $(CFLAGS) -o bin/false src/false.c @@ -296,4 +298,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 pscat roll rot13 stdbool str sysexits usefulmacros +.PHONY: all clean cleanlibraries cleanprograms echo pscat roll rot13 stdbool str sysexits usefulmacros diff --git a/echo/Makefile b/echo/Makefile new file mode 100644 index 0000000..d41bf7b --- /dev/null +++ b/echo/Makefile @@ -0,0 +1,28 @@ +all: echo + +clean: + rm -rf ../dist/echo ../dist/echo.tar ../dist/echo.tar.gz echo + +dist: ../dist/echo.tar.gz + +sane: echo.c ../include/sysexits.h + $(CC) -DDONT_USE_SYSTEM_SYSEXITS -o echo echo.c + +echo: echo.c + $(CC) -o echo echo.c + +../dist/echo: echo + mkdir -p ../dist/echo.tmp/bin/ ../dist/echo.tmp/share/man/man1/ + cp echo ../dist/echo.tmp/bin/echo + cp echo.1 ../dist/echo.tmp/share/man/man1/echo.1 + mv ../dist/echo.tmp ../dist/echo + +../dist/echo.tar: ../dist/echo + cd ../dist/echo && pax -w -x ustar . >../echo.tar.tmp + mv ../dist/echo.tar.tmp ../dist/echo.tar + +../dist/echo.tar.gz: ../dist/echo.tar + gzip -c <../dist/echo.tar >../dist/echo.tar.gz.tmp + mv ../dist/echo.tar.gz.tmp ../dist/echo.tar.gz + +.PHONY: all clean sane diff --git a/man/echo.1 b/echo/echo.1 similarity index 100% rename from man/echo.1 rename to echo/echo.1 diff --git a/src/echo.c b/echo/echo.c similarity index 100% rename from src/echo.c rename to echo/echo.c