From f914f2640834de73f0ad2d0b81d781d14d186745 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 7 Oct 2024 12:48:58 +0900 Subject: [PATCH 1/2] buile: Register a 'check' target. Also ensure the 'pace' test script fails noisily in case of problems. * Makefile (check): New target. * pace: Configure bash to use the -e option. --- Makefile | 3 +++ pace | 1 + 2 files changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 0b99a7d..373c01d 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,9 @@ install: cp ./cppp $(prefix)/bin/. cp ./cppp.1 $(prefix)/share/man/man1/. +check: + ./pace + clean: rm -f $(OBJLIST) cppp diff --git a/pace b/pace index 1118710..7779f84 100755 --- a/pace +++ b/pace @@ -1,4 +1,5 @@ #!/bin/bash +set -e # fail on error binary=${1:-./cppp} rm -f ./tests/pace.out for f in -Dfoo -Dbar -Dbaz -Ufoo -Ubar -Ubaz \ From dc8dde6fa270a9bf6cd75baabe5e91879afbe29d Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 7 Oct 2024 12:50:25 +0900 Subject: [PATCH 2/2] build: Use 'install -D' to automatically create insallation dirs. * Makefile (install): Replace 'cp' with 'install -D'. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 373c01d..63d0637 100644 --- a/Makefile +++ b/Makefile @@ -22,8 +22,8 @@ ppproc.o : ppproc.c ppproc.h gen.h error.h symset.h clexer.h exptree.h cppp.o : cppp.c gen.h unixisms.h error.h symset.h ppproc.h install: - cp ./cppp $(prefix)/bin/. - cp ./cppp.1 $(prefix)/share/man/man1/. + install -D ./cppp $(prefix)/bin/cppp + install -D ./cppp.1 $(prefix)/share/man/man1/cppp.1 check: ./pace