summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorChristopher Meng <i@cicku.me>2015-08-03 13:03:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-03 13:03:30 -0700
commitcaac8c95a04f3cf83eb81510680833e2c6cf26d5 (patch)
tree8bd1ae0c8194de422f0de0e1888c450d15d4ae9a /Makefile
parent1878f60ebdacdd52fb05a171eb07b4bc91e9704c (diff)
downloadtxr-caac8c95a04f3cf83eb81510680833e2c6cf26d5.tar.gz
txr-caac8c95a04f3cf83eb81510680833e2c6cf26d5.tar.bz2
txr-caac8c95a04f3cf83eb81510680833e2c6cf26d5.zip
Custom linker flags support.
* Makefile (PLATFORM_FLAGS): Rename to PLATFORM_CFLAGS. (LDFLAGS): New variable. Includes -lm and PLATFORM_CFLAGS. (LINK_PROG): Use $(LDFLAGS) instead of -lm. * configure (platform_flags): Renamed to platform_cflags. (platform_ldflags): New variable. (gen_config_make): Rename PLATFORM_CFLAGS and generate PLATFORM_LDFLAGS. Usage help text updated.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 2de239f1..e20fabd6 100644
--- a/Makefile
+++ b/Makefile
@@ -28,9 +28,10 @@
VERBOSE :=
CFLAGS := -iquote $(conf_dir) $(if $(top_srcdir),-iquote $(top_srcdir)) \
$(LANG_FLAGS) $(DIAG_FLAGS) \
- $(DBG_FLAGS) $(PLATFORM_FLAGS) $(EXTRA_FLAGS)
+ $(DBG_FLAGS) $(PLATFORM_CFLAGS) $(EXTRA_FLAGS)
CFLAGS += -iquote $(top_srcdir)mpi
CFLAGS := $(filter-out $(REMOVE_FLAGS),$(CFLAGS))
+LDFLAGS := -lm $(PLATFORM_LDFLAGS)
ifneq ($(subst g++,@,$(notdir $(CC))),$(notdir $(CC)))
CFLAGS := $(filter-out -Wmissing-prototypes -Wstrict-prototypes,$(CFLAGS))
@@ -105,7 +106,7 @@ endef
define LINK_PROG
$(call ABBREV,LINK)
-$(V)$(CC) $(1) $(CFLAGS) -o $@ $^ -lm
+$(V)$(CC) $(1) $(CFLAGS) -o $@ $^ $(LDFLAGS)
endef
define WINDRES