diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-18 11:50:53 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-18 11:50:53 +0000 |
commit | fbd8dc3b097243d69339f7b0add0629c92852651 (patch) | |
tree | 30f3833e7724441d64c7de65f8a7604ca110f021 /gcc/melt-module.mk | |
parent | c584bf46be80eec8dd8d6403c392ef1a80cab22d (diff) | |
download | gcc-fbd8dc3b097243d69339f7b0add0629c92852651.tar.gz |
2012-06-18 Basile Starynkevitch <basile@starynkevitch.net>
* melt-module.mk (GCCMELT_SECONDARY_CFILES): Rename
GCCMELT_SECONDARIES variable.
(GCCMELT_SECONDARY_MD5SUMS): Rename -GCCMELT_SECONDARIES_MD5
variable.
(GCCMELT_PRIMARY_MDSUMED_BASE): Rename GCCMELT_PRIMARY_OBJ
variable.
(GCCMELT_SECONDARY_MDSUMED_BASES): Rename GCCMELT_SECONDARIES_OBJ
variable.
Updated rules accordingly.
(melt_module): Use melt_workspace.
(melt_workspace): New phony target.
* melt/warmelt-base.melt (string4out): New function.
* melt/xtramelt-probe.melt (scanprobe_exec): Use it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@188730 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/melt-module.mk')
-rw-r--r-- | gcc/melt-module.mk | 68 |
1 files changed, 47 insertions, 21 deletions
diff --git a/gcc/melt-module.mk b/gcc/melt-module.mk index 549f76f0ce5..f88c8c7d0d1 100644 --- a/gcc/melt-module.mk +++ b/gcc/melt-module.mk @@ -29,7 +29,7 @@ #### GCCMELT_MODULE_FLAVOR=quicklybuilt #### to make moduledir/foo.so -.PHONY: melt_module +.PHONY: melt_module melt_workspace ### See also routine compile_gencsrc_to_binmodule of melt-runtime.c ifndef GCCMELT_MODULE_SOURCEBASE @@ -143,51 +143,70 @@ endif GCCMELT_PRIMARYMD5:= $(shell $(MD5SUM) $(GCCMELT_PRIMARY) | $(GAWK) '{print $$1}') ## the secondary C files, in order -GCCMELT_SECONDARIES= $(sort $(wildcard $(GCCMELT_MODULE_SOURCEBASE)+[09]*.c)) +GCCMELT_SECONDARY_CFILES= $(sort $(wildcard $(GCCMELT_MODULE_SOURCEBASE)+[09]*.c)) ## the corresponding checksums -GCCMELT_SECONDARIES_MD5:= $(if $(GCCMELT_SECONDARIES), \ - $(shell $(MD5SUM) $(GCCMELT_SECONDARIES) | $(GAWK) '{print $$1}')) +GCCMELT_SECONDARY_MD5SUMS:= $(if $(GCCMELT_SECONDARY_CFILES), \ + $(shell $(MD5SUM) $(GCCMELT_SECONDARY_CFILES) | $(GAWK) '{print $$1}')) ## the cumulated checksum -GCCMELT_CUMULATED_MD5 ?= $(shell cat $(GCCMELT_PRIMARY) $(GCCMELT_SECONDARIES) | $(MD5SUM) | $(GAWK) '{print $$1}') +GCCMELT_CUMULATED_MD5 ?= $(shell cat $(GCCMELT_PRIMARY) $(GCCMELT_SECONDARY_CFILES) | $(MD5SUM) | $(GAWK) '{print $$1}') ## the primary object basename -GCCMELT_PRIMARY_OBJ:= $(basename $(notdir $(GCCMELT_PRIMARY))).$(GCCMELT_PRIMARYMD5) +GCCMELT_PRIMARY_MDSUMED_BASE:= $(basename $(notdir $(GCCMELT_PRIMARY))).$(GCCMELT_PRIMARYMD5) ## the secondary objects basenames -GCCMELT_SECONDARIES_OBJ := $(join $(basename $(notdir $(GCCMELT_SECONDARIES))),$(addprefix .,$(GCCMELT_SECONDARIES_MD5))) +GCCMELT_SECONDARY_MDSUMED_BASES := $(join $(basename $(notdir $(GCCMELT_SECONDARY_CFILES))),$(addprefix .,$(GCCMELT_SECONDARY_MD5SUMS))) + + + vpath %.optimized.pic.o $(GCCMELT_MODULE_WORKSPACE) $(GCCMELT_MODULE_WORKSPACE)/%.optimized.pic.o: - [ -d $(GCCMELT_MODULE_WORKSPACE) ] || mkdir -p $(GCCMELT_MODULE_WORKSPACE) $(GCCMELT_CC) -DMELTGCC_MODULE_OPTIMIZED -DMELT_HAVE_DEBUG=0 $(GCCMELT_OPTIMIZED_FLAGS) $(GCCMELT_CFLAGS) \ -fPIC -c -o $@ $(patsubst %, $(GCCMELT_SOURCEDIR)%.c, $(basename $(basename $(basename $(basename $(notdir $@)))))) +##bad$(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_MDSUMED_BASE).optimized.pic.o: $(GCCMELT_MODULE_SOURCEBASE).c +##bad @echo melt-module optimized pic at= $@ inf= $< +##bad $(GCCMELT_CC) -DMELTGCC_MODULE_OPTIMIZED -DMELT_HAVE_DEBUG=0 $(GCCMELT_OPTIMIZED_FLAGS) \ +##bad $(GCCMELT_CFLAGS) -fPIC -c -o $@ $< vpath %.quicklybuilt.pic.o $(GCCMELT_MODULE_WORKSPACE) $(GCCMELT_MODULE_WORKSPACE)/%.quicklybuilt.pic.o: - [ -d $(GCCMELT_MODULE_WORKSPACE) ] || mkdir -p $(GCCMELT_MODULE_WORKSPACE) $(GCCMELT_CC) -DMELTGCC_MODULE_QUICKLYBUILT -DMELT_HAVE_DEBUG=1 $(GCCMELT_QUICKLYBUILT_FLAGS) $(GCCMELT_CFLAGS) \ -fPIC -c -o $@ $(patsubst %, $(GCCMELT_SOURCEDIR)%.c, $(basename $(basename $(basename $(basename $(notdir $@)))))) +##bad $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_MDSUMED_BASE).quicklybuilt.pic.o: $(GCCMELT_MODULE_SOURCEBASE).c +##bad @echo melt-module quicklybuilt pic at= $@ inf= $< +##bad $(GCCMELT_CC) -DMELTGCC_MODULE_QUICKLYBUILT -DMELT_HAVE_DEBUG=1 $(GCCMELT_QUICKLYBUILT_FLAGS) \ +##bad $(GCCMELT_CFLAGS) -fPIC -c -o $@ $< vpath %.debugnoline.pic.o $(GCCMELT_MODULE_WORKSPACE) $(GCCMELT_MODULE_WORKSPACE)/%.debugnoline.pic.o: - [ -d $(GCCMELT_MODULE_WORKSPACE) ] || mkdir -p $(GCCMELT_MODULE_WORKSPACE) $(GCCMELT_CC) -DMELTGCC_MODULE_DEBUGNOLINE -DMELTGCC_NOLINENUMBERING -DMELT_HAVE_DEBUG=1 $(GCCMELT_DEBUGNOLINE_FLAGS) $(GCCMELT_CFLAGS) \ -fPIC -c -o $@ $(patsubst %, $(GCCMELT_SOURCEDIR)%.c, $(basename $(basename $(basename $(basename $(notdir $@)))))) +##bad $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_MDSUMED_BASE).debugnoline.pic.o: $(GCCMELT_MODULE_SOURCEBASE).c +##bad @echo melt-module primary debugnoline pic at= $@ inf= $< +##bad $(GCCMELT_CC) -DMELTGCC_MODULE_DEBUGNOLINE -DMELTGCC_NOLINENUMBERING -DMELT_HAVE_DEBUG=1 $(GCCMELT_DEBUGNOLINE_FLAGS) \ +##bad $(GCCMELT_CFLAGS) -fPIC -c -o $@ $< vpath %.dynamic.pic.o $(GCCMELT_MODULE_WORKSPACE) - $(GCCMELT_MODULE_WORKSPACE)/%.dynamic.pic.o: - [ -d $(GCCMELT_MODULE_WORKSPACE) ] || mkdir -p $(GCCMELT_MODULE_WORKSPACE) +$(GCCMELT_MODULE_WORKSPACE)/%.dynamic.pic.o: $(GCCMELT_CC) -DMELTGCC_MODULE_DEBUGNOLINE -DMELT_HAVE_DEBUG=1 -DMELTGCC_DYNAMIC_OBJSTRUCT $(GCCMELT_DYNAMIC_FLAGS) $(GCCMELT_CFLAGS) \ -fPIC -c -o $@ $(patsubst %, $(GCCMELT_SOURCEDIR)%.c, $(basename $(basename $(basename $(basename $(notdir $@)))))) +##bad $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_MDSUMED_BASE).dynamic.pic.o: $(GCCMELT_MODULE_SOURCEBASE).c +##bad @echo melt-module primary dynamic pic at= $@ inf= $< +##bad $(GCCMELT_CC) -DMELTGCC_MODULE_DEBUGNOLINE -DMELT_HAVE_DEBUG=1 -DMELTGCC_DYNAMIC_OBJSTRUCT $(GCCMELT_DYNAMIC_FLAGS) \ +##bad $(GCCMELT_CFLAGS) -fPIC -c -o $@ $< + + +################ $(GCCMELT_MODULE_WORKSPACE)/$(basename $(notdir $(GCCMELT_DESC))).$(GCCMELT_CUMULATED_MD5).pic.o: $(GCCMELT_DESC) $(GCCMELT_TIMEF) [ -d $(GCCMELT_MODULE_WORKSPACE) ] || mkdir -p $(GCCMELT_MODULE_WORKSPACE) $(GCCMELT_CC) -DMELTGCC_MODULE_DESCRFILE $(GCCMELT_CFLAGS) -fPIC -c -o $@ $< + $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_BASE).$(GCCMELT_CUMULATED_MD5).optimized.so: \ - $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_OBJ).optimized.pic.o \ - $(addsuffix .optimized.pic.o, $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_OBJ) $(patsubst %,$(GCCMELT_MODULE_WORKSPACE)/%,$(GCCMELT_SECONDARIES_OBJ))) \ + $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_MDSUMED_BASE).optimized.pic.o \ + $(addsuffix .optimized.pic.o, $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_MDSUMED_BASE) $(patsubst %,$(GCCMELT_MODULE_WORKSPACE)/%,$(GCCMELT_SECONDARY_MDSUMED_BASES))) \ $(GCCMELT_MODULE_WORKSPACE)/$(basename $(notdir $(GCCMELT_DESC))).$(GCCMELT_CUMULATED_MD5).pic.o [ -d $(GCCMELT_MODULE_WORKSPACE) ] || mkdir -p $(GCCMELT_MODULE_WORKSPACE) $(MAKE) -f $(filter %melt-module.mk, $(MAKEFILE_LIST)) $^ \ @@ -198,9 +217,10 @@ $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_BASE).$(GCCMELT_CUMULATED_MD5).optimized.s GCCMELT_CUMULATED_MD5=$(GCCMELT_CUMULATED_MD5) $(GCCMELT_CC) $(GCCMELT_OPTIMIZED_FLAGS) $(GCCMELT_CFLAGS) -fPIC $(SHARED_LIBRARY_FLAGS) -o $@ $^ $(GCCMELT_MODULE_EXTRALIBES) + $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_BASE).$(GCCMELT_CUMULATED_MD5).dynamic.so: \ - $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_OBJ).dynamic.pic.o \ - $(addsuffix .dynamic.pic.o, $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_OBJ) $(patsubst %,$(GCCMELT_MODULE_WORKSPACE)/%,$(GCCMELT_SECONDARIES_OBJ))) \ + $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_MDSUMED_BASE).dynamic.pic.o \ + $(addsuffix .dynamic.pic.o, $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_MDSUMED_BASE) $(patsubst %,$(GCCMELT_MODULE_WORKSPACE)/%,$(GCCMELT_SECONDARY_MDSUMED_BASES))) \ $(GCCMELT_MODULE_WORKSPACE)/$(basename $(notdir $(GCCMELT_DESC))).$(GCCMELT_CUMULATED_MD5).pic.o $(MAKE) -f $(filter %melt-module.mk, $(MAKEFILE_LIST)) $^ \ GCCMELT_MODULE_SOURCEBASE=$(GCCMELT_MODULE_SOURCEBASE) \ @@ -210,9 +230,10 @@ $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_BASE).$(GCCMELT_CUMULATED_MD5).dynamic.so: GCCMELT_CUMULATED_MD5=$(GCCMELT_CUMULATED_MD5) $(GCCMELT_CC) $(GCCMELT_DYNAMIC_FLAGS) $(GCCMELT_CFLAGS) -fPIC $(SHARED_LIBRARY_FLAGS) -o $@ $^ $(GCCMELT_MODULE_EXTRALIBES) + $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_BASE).$(GCCMELT_CUMULATED_MD5).quicklybuilt.so: \ - $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_OBJ).quicklybuilt.pic.o \ - $(addsuffix .quicklybuilt.pic.o, $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_OBJ) $(patsubst %,$(GCCMELT_MODULE_WORKSPACE)/%,$(GCCMELT_SECONDARIES_OBJ))) \ + $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_MDSUMED_BASE).quicklybuilt.pic.o \ + $(addsuffix .quicklybuilt.pic.o, $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_MDSUMED_BASE) $(patsubst %,$(GCCMELT_MODULE_WORKSPACE)/%,$(GCCMELT_SECONDARY_MDSUMED_BASES))) \ $(GCCMELT_MODULE_WORKSPACE)/$(basename $(notdir $(GCCMELT_DESC))).$(GCCMELT_CUMULATED_MD5).pic.o $(MAKE) -f $(filter %melt-module.mk, $(MAKEFILE_LIST)) $^ \ GCCMELT_MODULE_SOURCEBASE=$(GCCMELT_MODULE_SOURCEBASE) \ @@ -224,8 +245,8 @@ $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_BASE).$(GCCMELT_CUMULATED_MD5).quicklybuil $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_BASE).$(GCCMELT_CUMULATED_MD5).debugnoline.so: \ - $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_OBJ).debugnoline.pic.o \ - $(addsuffix .debugnoline.pic.o, $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_OBJ) $(patsubst %,$(GCCMELT_MODULE_WORKSPACE)/%,$(GCCMELT_SECONDARIES_OBJ))) \ + $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_MDSUMED_BASE).debugnoline.pic.o \ + $(addsuffix .debugnoline.pic.o, $(GCCMELT_MODULE_WORKSPACE)/$(GCCMELT_PRIMARY_MDSUMED_BASE) $(patsubst %,$(GCCMELT_MODULE_WORKSPACE)/%,$(GCCMELT_SECONDARY_MDSUMED_BASES))) \ $(GCCMELT_MODULE_WORKSPACE)/$(basename $(notdir $(GCCMELT_DESC))).$(GCCMELT_CUMULATED_MD5).pic.o $(MAKE) -f $(filter %melt-module.mk, $(MAKEFILE_LIST)) $^ \ GCCMELT_MODULE_SOURCEBASE=$(GCCMELT_MODULE_SOURCEBASE) \ @@ -242,6 +263,11 @@ $(GCCMELT_MODULE_BINARYBASE).$(GCCMELT_MODULE_FLAVOR).so: $(GCCMELT_MODULE_WORKS -melt_module: $(GCCMELT_MODULE_BINARYBASE).$(GCCMELT_MODULE_FLAVOR).so +melt_module: melt_workspace $(GCCMELT_MODULE_BINARYBASE).$(GCCMELT_MODULE_FLAVOR).so + +melt_workspace: + @echo workspace $(GCCMELT_MODULE_WORKSPACE) GCCMELT_PRIMARY_MDSUMED_BASE= $(GCCMELT_PRIMARY_MDSUMED_BASE) GCCMELT_SECONDARY_MDSUMED_BASES= $(GCCMELT_SECONDARY_MDSUMED_BASES) GCCMELT_MODULE_SOURCEBASE= $(GCCMELT_MODULE_SOURCEBASE) + [ -d $(GCCMELT_MODULE_WORKSPACE) ] || mkdir -p $(GCCMELT_MODULE_WORKSPACE) + ## eof melt-module.mk |