cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit 5cee758069a44bc8f656eeae054c19393b7381ee
parent 9be024da84f251e0de7603fcfeb90a9746a16864
Author: Michael Forney <mforney@mforney.org>
Date:   Sun, 19 Apr 2020 16:42:32 -0700

Add install target to Makefile

Diffstat:
MMakefile | 7+++++++
Mconfigure | 6++++++
2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,5 +1,7 @@ .POSIX: +PREFIX=/usr/local +BINDIR=$(PREFIX)/bin BACKEND=qbe objdir=. @@ -84,6 +86,11 @@ bootstrap: stage2 stage3 check: all @CCQBE=./cproc-qbe ./runtests +.PHONY: install +install: all + mkdir -p $(DESTDIR)$(BINDIR) + cp $(objdir)/cproc $(objdir)/cproc-qbe $(DESTDIR)$(BINDIR) + .PHONY: qbe qbe: git submodule update --init qbe diff --git a/configure b/configure @@ -5,12 +5,16 @@ fail() { exit 1 } +prefix=/usr/local +bindir='$(PREFIX)/bin' host= target= gcclibdir= for arg ; do case "$arg" in + --prefix=*) prefix=${arg#*=} ;; + --bindir=*) bindir=${arg#*=} ;; --host=*) host=${arg#*=} ;; --target=*) target=${arg#*=} ;; --with-cpp=*) DEFAULT_PREPROCESSOR=${arg#*=} ;; @@ -152,6 +156,8 @@ echo done printf "creating config.mk... " cat >config.mk <<EOF +PREFIX=$prefix +BINDIR=$bindir CC=${CC:-cc} CFLAGS=${CFLAGS:--std=c11 -Wall -Wpedantic -Wno-parentheses -Wno-switch -g -pipe} LDFLAGS=$LDFLAGS