summaryrefslogtreecommitdiff
path: root/Makefile.direct
diff options
context:
space:
mode:
authorKristian Larsson <kristian@spritelink.net>2022-10-19 18:56:38 +0200
committerIvan Maidanski <ivmai@mail.ru>2022-10-20 19:14:21 +0300
commitf7cfa9d105cb6795fa93d432b7f04c2f07730a38 (patch)
treee167f3592c6fb7b1184a6907ef50f3668dd64e1f /Makefile.direct
parent9135a7eab9b80aaab309f71055e040165509837a (diff)
downloadbdwgc-f7cfa9d105cb6795fa93d432b7f04c2f07730a38.tar.gz
Allow passing custom CFLAGS[_EXTRA] to Makefile.direct
Issue #483 (bdwgc). By using ?= we only set the CFLAGS variable in case it doesn't already have a value. This means it is now possible for someone to control the way bdwgc is compiled by feeding in the CFLAGS variable whereas previously one had to modify the Makefile.direct file. Further, since we consider the CFLAGS a reasonable default, the primary means of injecting control flags is by setting CFLAGS_EXTRA, where we now also allow passing in a value and the stuff in Makefile.direct is appended to that input. Same for [AS_]ABI_FLAG and CXXFLAGS variables. * Makefile.direct (ABI_FLAG, AS_ABI_FLAG, CFLAGS_EXTRA, CFLAGS, CXXFLAGS): Assign value using operator "?=" instead of "=" one.
Diffstat (limited to 'Makefile.direct')
-rw-r--r--Makefile.direct10
1 files changed, 5 insertions, 5 deletions
diff --git a/Makefile.direct b/Makefile.direct
index fbd39ec9..a2bdaec0 100644
--- a/Makefile.direct
+++ b/Makefile.direct
@@ -13,13 +13,13 @@
# check-cpp-deps - same as check-cpp but do not run the test
# cord/de - builds dumb editor based on cords.
-ABI_FLAG=
+ABI_FLAG?=
# ABI_FLAG should be the cc flag that specifies the ABI. On most
# platforms this will be the empty string. Possible values:
# +DD64 for 64-bit executable on HP/UX.
# -n32, -n64, -o32 for SGI/MIPS ABIs.
-AS_ABI_FLAG=$(ABI_FLAG)
+AS_ABI_FLAG?=$(ABI_FLAG)
# ABI flag for assembler. On HP/UX this is +A64 for 64 bit
# executables.
@@ -45,9 +45,9 @@ VPATH= $(srcdir)
# Path to atomic_ops source.
AO_SRC_DIR=$(srcdir)/libatomic_ops
-CFLAGS_EXTRA=
+CFLAGS_EXTRA?=
# We need CFLAGS_FOR_PIC because we might be building a shared library.
-CFLAGS= -O -I$(srcdir)/include -I$(AO_SRC_DIR)/src \
+CFLAGS?= -O -I$(srcdir)/include -I$(AO_SRC_DIR)/src \
-DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE \
-DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION \
-DUSE_MMAP -DUSE_MUNMAP $(CFLAGS_FOR_PIC) $(CFLAGS_EXTRA)
@@ -77,7 +77,7 @@ HOSTCFLAGS=$(CFLAGS)
# Look into doc/README.macros for the description of the "define arguments"
# influencing the collector configuration.
-CXXFLAGS= $(CFLAGS)
+CXXFLAGS?= $(CFLAGS)
AR= ar
RANLIB= ranlib