summaryrefslogtreecommitdiff
path: root/gcc/melt-module.mk
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-11 14:41:17 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-11 14:41:17 +0000
commit5e7adbc81b43b579675a1035500f991404cf8218 (patch)
tree2950946b7aa8a1817743f243f4e0d14240f52f1c /gcc/melt-module.mk
parent3c046cee5c0bf747fb65766c814b51c24fefc0c1 (diff)
downloadgcc-5e7adbc81b43b579675a1035500f991404cf8218.tar.gz
2012-09-11 Basile Starynkevitch <basile@starynkevitch.net>
{{adding flavor runextend}} * melt-module.mk: Add runextend flavor. * melt-runtime.c (melt_compile_source): Accept runextend flavor. * melt/warmelt-outobj.melt (translate_run_melt_expressions): Generate a runextend flavor of the module. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@191187 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/melt-module.mk')
-rw-r--r--gcc/melt-module.mk35
1 files changed, 34 insertions, 1 deletions
diff --git a/gcc/melt-module.mk b/gcc/melt-module.mk
index 6fd0b5f63f3..4a09e378b39 100644
--- a/gcc/melt-module.mk
+++ b/gcc/melt-module.mk
@@ -72,7 +72,7 @@ $(warning MELT time stamp file $(GCCMELT_MODULE_SOURCEBASE)+melttime.h does not
endif
## check the flavor
-ifeq ($(findstring $(GCCMELT_MODULE_FLAVOR),optimized quicklybuilt debugnoline dynamic),)
+ifeq ($(findstring $(GCCMELT_MODULE_FLAVOR),optimized quicklybuilt debugnoline dynamic runextend),)
$(error invalid GCCMELT_MODULE_FLAVOR $(GCCMELT_MODULE_FLAVOR))
endif
@@ -140,6 +140,7 @@ GCCMELT_QUICKLYBUILT_FLAGS ?= -O0 -Wall
GCCMELT_DYNAMIC_FLAGS ?= -O0
GCCMELT_DEBUGNOLINE_FLAGS ?= -g
GCCMELT_DESCRIPTOR_FLAGS ?= -O
+GCCMELT_RUNEXTEND_FLAGS ?= -O0
## these flags are preprocessor flags depending upon the flavor, don't override them without reason
GCCMELT_QUICKLYBUILT_PREPROFLAGS= -DMELTGCC_MODULE_QUICKLYBUILT -DMELT_HAVE_DEBUG=1
@@ -147,6 +148,7 @@ GCCMELT_OPTIMIZED_PREPROFLAGS= -DMELTGCC_MODULE_OPTIMIZED -DMELT_HAVE_DEBUG=0
GCCMELT_DEBUGNOLINE_PREPROFLAGS= -DMELTGCC_MODULE_DEBUGNOLINE -DMELTGCC_NOLINENUMBERING -DMELT_HAVE_DEBUG=1
GCCMELT_DYNAMIC_PREPROFLAGS= -DMELTGCC_MODULE_DYNAMIC -DMELTGCC_NOLINENUMBERING -DMELT_HAVE_DEBUG=1 -DMELTGCC_DYNAMIC_OBJSTRUCT
GCCMELT_DESCRIPTOR_PREPROFLAGS= -DMELTGCC_MODULE_DESCRIPTOR
+GCCMELT_RUNEXTEND_PREPROFLAGS= -DMELTGCC_MODULE_RUNEXTEND -DMELTGCC_NOLINENUMBERING -DMELT_HAVE_DEBUG=1
GCCMELT_PREPROFLAGS= -I $(realpath $(GCCMELT_HEADER_DIR))
@@ -267,6 +269,30 @@ $(GCCMELTGEN_BUILD)%.dynamic.meltmdsumedpic.o: $(GCCMELTGEN_BUILD)%.mdsumed.c |
+
+## runextend flavor
+$(GCCMELTGEN_BUILD)%.runextend.meltpic.o: | $(GCCMELT_MODULE_DEPENDENCIES)
+ @echo @+@melt-module runextend.meltpic at= $@ left= $< question= $? caret= $^ realpathleft= $(realpath $<)
+ if [ -z "$(filter %.mdsumed.c, $(realpath $<))" ]; then \
+ $(GCCMELT_COMPILER) $(GCCMELT_RUNEXTEND_PREPROFLAGS) $(GCCMELT_PREPROFLAGS) \
+ $(GCCMELT_RUNEXTEND_FLAGS) $(GCCMELT_CFLAGS) $(GCCMELT_PACKAGES_CFLAGS) \
+ -fPIC -c -o $@ $< ; \
+ else \
+ GCCMELTGENMDSUMEDPIC=$(GCCMELTGEN_BUILD)$(notdir $(patsubst %.mdsumed.c,%.runextend.meltmdsumedpic.o,$(realpath $<))); \
+ echo @+@melt-module runextend.meltpicmd GCCMELTGENMDSUMEDPIC= $$GCCMELTGENMDSUMEDPIC ; \
+ $(MAKE) -e -f $(filter %melt-module.mk, $(MAKEFILE_LIST)) $$GCCMELTGENMDSUMEDPIC ; \
+ $(LN_S) -v -f `realpath $$GCCMELTGENMDSUMEDPIC` $@ ; fi
+
+$(GCCMELTGEN_BUILD)%.runextend.meltmdsumedpic.o: $(GCCMELTGEN_BUILD)%.mdsumed.c | $(GCCMELT_MODULE_DEPENDENCIES)
+ @echo @+@melt-module runextend.meltmdsumedpic at= $@ left= $< question= $? caret= $^
+ $(GCCMELT_COMPILER) $(GCCMELT_RUNEXTEND_PREPROFLAGS) $(GCCMELT_PREPROFLAGS) \
+ $(GCCMELT_DEBUGNOLINE_FLAGS) $(GCCMELT_CFLAGS) $(GCCMELT_PACKAGES_CFLAGS) \
+ -fPIC -c -o $@ $<
+
+
+
+################
+
## descriptor quasi-flavor, never symlinked!
$(GCCMELTGEN_BUILD)%.descriptor.meltpic.o: | $(GCCMELT_MODULE_DEPENDENCIES)
@echo @+@melt-module descriptor.meltpic at= $@ left= $< question= $? caret= $^
@@ -275,6 +301,7 @@ $(GCCMELTGEN_BUILD)%.descriptor.meltpic.o: | $(GCCMELT_MODULE_DEPENDENCIES)
-fPIC -c -o $@ $<
+################################################################
## linking the module in various flavors
$(GCCMELTGEN_BUILD)$(GCCMELT_BASE).meltmod-%.quicklybuilt.so:
@echo @+@melt-module meltmod.quicklybuilt at= $@ left= $< question= $? caret= $^
@@ -293,6 +320,12 @@ $(GCCMELTGEN_BUILD)$(GCCMELT_BASE).meltmod-%.dynamic.so:
$(GCCMELT_COMPILER) $(GCCMELT_DYNAMIC_FLAGS) $(GCCMELT_SHARED_FLAGS) -o $@ $^ $(GCCMELT_PACKAGES_LIBES)
+$(GCCMELTGEN_BUILD)$(GCCMELT_BASE).meltmod-%.runextend.so:
+ @echo @+@melt-module meltmod.runextend at= $@ left= $< question= $? caret= $^
+ $(GCCMELT_COMPILER) $(GCCMELT_RUNEXTEND_FLAGS) $(GCCMELT_SHARED_FLAGS) -o $@ $^ $(GCCMELT_PACKAGES_LIBES)
+
+
+
################
ifneq ($(realpath $(GCCMELTGEN_BUILD)),$(realpath $(dir $(GCCMELT_MODULE_BINARYBASE))))
$(info hereGCCMELTGEN_BUILD=$(GCCMELTGEN_BUILD) real= $(realpath $(GCCMELTGEN_BUILD)) GCCMELT_MODULE_BINARYBASE=$(GCCMELT_MODULE_BINARYBASE) realdir= $(realpath $(dir $(GCCMELT_MODULE_BINARYBASE))) dir= $(dir $(GCCMELT_MODULE_BINARYBASE)))