From 5eba1c7003c0416aa32d61dbd4a80c6541add0f1 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Thu, 21 Apr 2022 19:00:51 -0400 Subject: make include dir a configure option --- Makefile | 5 +++-- configure | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8c5dbdd3..ebfe963e 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,15 @@ .POSIX: +include .config.mk + AR=ar ARFLAGS=rU -BASE_CFLAGS=-g -Wall -Wextra -Werror -nostdinc -fno-builtin -fno-stack-protector -fPIC -Iinclude -Isrc +BASE_CFLAGS=-g -Wall -Wextra -Werror -nostdinc -fno-builtin -fno-stack-protector -fPIC -I$(INCDIR) -Isrc OBJDIR=obj SRCDIR=src all: -include .config.mk include mk/all.mk cleandeps: diff --git a/configure b/configure index 48254845..47be6631 100755 --- a/configure +++ b/configure @@ -11,6 +11,8 @@ show_help() { Options: -d Enable debugging symbols and asserts + -I dir Set the directory to use for #include files + -a arch Choose the underlying architecture to build for: $(awk '{ printf("\t%s\n", $0); }' ${CONFIGDIR}/architecture.conf) @@ -52,13 +54,14 @@ option= architecture=x86 wordsize=64 debug=0 +include= standard_c= posix= xopen= cext= -while getopts dhc:p:x:X: option; do +while getopts dhc:p:x:I:X: option; do case ${option} in a) architecture=$(validate_option architecture ${OPTARG}) ;; c) standard_c=$(validate_option c ${OPTARG}) ;; @@ -66,6 +69,7 @@ while getopts dhc:p:x:X: option; do w) wordsize=$(validate_option wordsize ${OPTARG}) ;; x) xopen=$(validate_option xopen ${OPTARG}) ;; X) cext=$(validate_option cext ${OPTARG}) ;; + I) include=${OPTARG} ;; d) debug=1 ;; h) show_help @@ -131,7 +135,7 @@ cat <<-EOF > .config.mk WORDSIZE=${wordsize} TOPDIR=$(dirname $0) SRCDIR=\$(TOPDIR)/src - INCDIR=\$(TOPDIR)/include + INCDIR=${include} OBJDIR=./obj EOF -- cgit v1.2.1