aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/c_src.mk
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/c_src.mk')
-rw-r--r--plugins/c_src.mk20
1 files changed, 13 insertions, 7 deletions
diff --git a/plugins/c_src.mk b/plugins/c_src.mk
index e23c7b9..5616923 100644
--- a/plugins/c_src.mk
+++ b/plugins/c_src.mk
@@ -2,7 +2,6 @@
# This file is part of erlang.mk and subject to the terms of the ISC License.
.PHONY: clean-c_src distclean-c_src-env
-# todo
# Configuration.
@@ -50,7 +49,11 @@ link_verbose = $(link_verbose_$(V))
ifeq ($(wildcard $(C_SRC_DIR)),)
else ifneq ($(wildcard $(C_SRC_DIR)/Makefile),)
app::
- $(MAKE) -C $(C_SRC_DIR)
+ $(MAKE) -C $(C_SRC_DIR) \
+ CFLAGS="$(CFLAGS)" \
+ CXXFLAGS="$(CXXFLAGS)" \
+ LDLIBS="$(LDLIBS)" \
+ LDFLAGS="$(LDFLAGS)"
clean::
$(MAKE) -C $(C_SRC_DIR) clean
@@ -80,6 +83,14 @@ $(C_SRC_OUTPUT): $(OBJECTS)
%.o: %.cpp
$(COMPILE_CPP) $(OUTPUT_OPTION) $<
+clean:: clean-c_src
+
+clean-c_src:
+ $(gen_verbose) rm -f $(C_SRC_OUTPUT) $(OBJECTS)
+
+endif
+
+ifneq ($(wildcard $(C_SRC_DIR)),)
$(C_SRC_ENV):
@$(ERL) -eval "file:write_file(\"$(C_SRC_ENV)\", \
io_lib:format( \
@@ -91,11 +102,6 @@ $(C_SRC_ENV):
code:lib_dir(erl_interface, lib)])), \
halt()."
-clean:: clean-c_src
-
-clean-c_src:
- $(gen_verbose) rm -f $(C_SRC_OUTPUT) $(OBJECTS)
-
distclean:: distclean-c_src-env
distclean-c_src-env: