head 1.2; access; symbols pkgsrc-2026Q1:1.2.0.14 pkgsrc-2026Q1-base:1.2 pkgsrc-2025Q4:1.2.0.12 pkgsrc-2025Q4-base:1.2 pkgsrc-2025Q3:1.2.0.10 pkgsrc-2025Q3-base:1.2 pkgsrc-2025Q2:1.2.0.8 pkgsrc-2025Q2-base:1.2 pkgsrc-2025Q1:1.2.0.6 pkgsrc-2025Q1-base:1.2 pkgsrc-2024Q4:1.2.0.4 pkgsrc-2024Q4-base:1.2 pkgsrc-2024Q3:1.2.0.2 pkgsrc-2024Q3-base:1.2; locks; strict; comment @# @; 1.2 date 2024.07.30.13.59.59; author schmonz; state Exp; branches; next 1.1; commitid MRThi9mYdh1DTRjF; 1.1 date 2024.07.24.11.48.59; author schmonz; state Exp; branches; next ; commitid EQrfcwxoVjmIm5jF; desc @@ 1.2 log @pnut: fix staged installation. Reported by wiz@@. @ text @$NetBSD: patch-Makefile,v 1.1 2024/07/24 11:48:59 schmonz Exp $ Support DESTDIR. --- Makefile.orig 2024-07-24 01:32:21.000000000 +0000 +++ Makefile @@@@ -1,24 +1,24 @@@@ -.PHONY: pnut-sh pnut.sh pnut-bootstrapped.sh install clean test +.PHONY: install clean test BUILD_DIR = build BUILD_OPT_SH = -DRELEASE_PNUT_SH $(BUILD_OPT) -pnut-sh: pnut.c sh.c sh-runtime.c +$(BUILD_DIR)/pnut-sh: pnut.c sh.c sh-runtime.c mkdir -p $(BUILD_DIR) gcc $(BUILD_OPT_SH) pnut.c -o $(BUILD_DIR)/pnut-sh -pnut.sh: pnut-sh +$(BUILD_DIR)/pnut.sh: $(BUILD_DIR)/pnut-sh ./$(BUILD_DIR)/pnut-sh $(BUILD_OPT_SH) pnut.c > $(BUILD_DIR)/pnut.sh chmod +x $(BUILD_DIR)/pnut.sh -pnut-bootstrapped.sh: pnut-sh +$(BUILD_DIR)/pnut-bootstrapped.sh: $(BUILD_DIR)/pnut-sh $$SHELL $(BUILD_DIR)/pnut.sh $(BUILD_OPT_SH) pnut.c > $(BUILD_DIR)/pnut-bootstrapped.sh diff $(BUILD_DIR)/pnut.sh $(BUILD_DIR)/pnut-bootstrapped.sh -install: pnut-sh pnut.sh - sudo cp $(BUILD_DIR)/pnut-sh /usr/local/bin/pnut - sudo cp $(BUILD_DIR)/pnut.sh /usr/local/bin/pnut.sh +install: $(BUILD_DIR)/pnut-sh $(BUILD_DIR)/pnut.sh + $(BSD_INSTALL_PROGRAM) $(BUILD_DIR)/pnut-sh $(DESTDIR)$(PREFIX)/bin/pnut + $(BSD_INSTALL_SCRIPT) $(BUILD_DIR)/pnut.sh $(DESTDIR)$(PREFIX)/bin/pnut.sh uninstall: sudo $(RM) /usr/local/bin/pnut @ 1.1 log @Add pnut: C compiler written in POSIX shell and generating POSIX shell scripts Pnut compiles a reasonably large subset of C99 to human-readable POSIX shell scripts. It can be used to generate portable shell scripts without having to write shell. Its main uses are: - As a transpiler to write portable shell scripts in C - As a way to bootstrap a compiler written in C with an executable version that is still human readable Main features: - No new language to learn -- C code in, shell code out - The human-readable shell script is easy to read and understand. - A runtime library including file I/O and dynamic memory allocations - A preprocessor - Integrates easily with existing shell scripts @ text @d1 1 a1 1 $NetBSD$ d5 1 a5 1 --- Makefile.orig 2024-07-24 11:40:54.704999845 +0000 d34 2 a35 2 + sudo cp $(BUILD_DIR)/pnut-sh $(DESTDIR)$(PREFIX)/bin/pnut + sudo cp $(BUILD_DIR)/pnut.sh $(DESTDIR)$(PREFIX)/bin/pnut.sh @