2017-05-28 16:32:53 +00:00
|
|
|
ifneq ($(MES),)
|
2017-05-21 20:25:02 +00:00
|
|
|
CROSS:=mes-
|
2017-06-03 10:11:57 +00:00
|
|
|
C_FILES:=mlibc/libc-mes.c $(C_FILES)
|
2017-05-21 20:25:02 +00:00
|
|
|
O_FILES:=$(C_FILES:%.c=$(OUT)/%.$(CROSS)o)
|
|
|
|
|
|
|
|
ifneq ($(DEBUG),)
|
|
|
|
$(info TARGET=$(TARGET))
|
|
|
|
$(info C_FILES=$(C_FILES))
|
|
|
|
$(info O_FILES=$(O_FILES))
|
|
|
|
endif
|
|
|
|
|
|
|
|
CLEAN+=$(O_FILES) $(OUT)/$(TARGET)
|
|
|
|
|
2017-04-12 19:27:59 +00:00
|
|
|
CLEAN+=$(OUT)/$(TARGET)
|
2017-05-21 20:25:02 +00:00
|
|
|
|
2017-06-03 10:11:57 +00:00
|
|
|
INCLUDES+=mlibc/include mlibc $(OUT)/$(DIR)
|
2017-05-21 20:25:02 +00:00
|
|
|
MESCC.mes:=scripts/mescc.mes
|
|
|
|
MESLD.mes:=scripts/mescc.mes
|
|
|
|
|
|
|
|
$(OUT)/$(TARGET): ld:=MESLD.mes
|
|
|
|
$(OUT)/$(TARGET): LD:=$(MESLD.mes)
|
|
|
|
$(OUT)/$(TARGET): CC:=$(MESCC.mes)
|
|
|
|
$(OUT)/$(TARGET): CFLAGS:=
|
|
|
|
$(OUT)/$(TARGET): LDFLAGS:=
|
2017-05-22 19:15:58 +00:00
|
|
|
$(OUT)/$(TARGET): $(MAKEFILE_LIST)
|
|
|
|
$(OUT)/$(TARGET): scripts/mes
|
2017-05-21 20:25:02 +00:00
|
|
|
$(OUT)/$(TARGET): O_FILES:=$(O_FILES)
|
|
|
|
$(OUT)/$(TARGET): $(O_FILES)
|
|
|
|
@echo " $(ld) $(notdir $(O_FILES)) -> $(notdir $@)"
|
|
|
|
$(QUIET)$(LINK.c) $(O_FILES) $(LOADLIBES) $(LDLIBS) -o $@
|
|
|
|
|
|
|
|
define mescc.mes-c-compile
|
2017-05-22 19:15:58 +00:00
|
|
|
$(OUT)/$(1:.c=.$(CROSS)o): CROSS:=$(CROSS)
|
2017-05-21 20:25:02 +00:00
|
|
|
$(OUT)/$(1:.c=.$(CROSS)o): cc:=MESCC.mes
|
|
|
|
$(OUT)/$(1:.c=.$(CROSS)o): CC:=$(MESCC.mes)
|
|
|
|
$(OUT)/$(1:.c=.$(CROSS)o): COMPILE.c:=$(MESCC.mes) -c
|
|
|
|
$(OUT)/$(1:.c=.$(CROSS)o): CPPFLAGS:=$(2:%=-D %) $(3:%=-I %)
|
|
|
|
$(OUT)/$(1:.c=.$(CROSS)o): COMPILE.c:=$(MESCC.mes) -c $(CPPFLAGS)
|
core: Always include reader.c, drop binary read-0-32.mo dependency.
* module/language/c99/compiler.mes (c99-input->full-ast): Remove
obsolete __NYACC__ and MES_FULL defines.
* src/mes.c [!MES_FULL]: Include reader-mes.h.
(mes_builtins) [!MES_FULL]: Include reader.mes.i, reader.me.environment.i.
[!MES_FULL]: Include reader.c.
(main) [!MES_FULL]: By default call load_env, only call bload_env
when --load is supplied. WAS: Always bload read-0-32.mo.
* src/reader.c (__end_of__mes_): Remove.
(dump): Remove option of dumping tiny test program.
* make/mescc-mes.make ($(OUT)/$(TARGET), mescc.mes-ccompile,
mescc.mes.c-compile-E): Depend on $(OUT)/mes, scripts/mes.
* src/src.make (mes.guile): Remove module/mes/read-32-0 dependency.
Do not build $(OUT)/mes.mes.
* module/module.make (module/mes/read-0.mo, module/mes/read-0-32.mo,
module/mes/tiny-0-32.mo): Remove targets.
(CLEAN): Do not add them. Neither install $(OUT)/mes.mes.
* .gitignore: Remove exceptions for them.
* make/install.make (install): Do not install them.
* HACKING: Update info about creating module/mes/read-32-0.mo.
* scaffold/mini-mes.c: Remove.
* scaffold/tiny-mes.c: Remove.
* scaffold/cons-mes.c: Remove.
* scaffold/scaffold.make (tiny-mes.libc, tiny-mes.guile, tiny-mes.mes,
mini-mes.libc, mini-mes.guile, mini-mes.mes): Reemove targets.
2017-05-28 14:03:45 +00:00
|
|
|
$(OUT)/$(1:.c=.$(CROSS)o): OUT:=$(OUT)
|
2017-05-22 19:15:58 +00:00
|
|
|
$(OUT)/$(1:.c=.$(CROSS)o): $(MAKEFILE_LIST)
|
core: Always include reader.c, drop binary read-0-32.mo dependency.
* module/language/c99/compiler.mes (c99-input->full-ast): Remove
obsolete __NYACC__ and MES_FULL defines.
* src/mes.c [!MES_FULL]: Include reader-mes.h.
(mes_builtins) [!MES_FULL]: Include reader.mes.i, reader.me.environment.i.
[!MES_FULL]: Include reader.c.
(main) [!MES_FULL]: By default call load_env, only call bload_env
when --load is supplied. WAS: Always bload read-0-32.mo.
* src/reader.c (__end_of__mes_): Remove.
(dump): Remove option of dumping tiny test program.
* make/mescc-mes.make ($(OUT)/$(TARGET), mescc.mes-ccompile,
mescc.mes.c-compile-E): Depend on $(OUT)/mes, scripts/mes.
* src/src.make (mes.guile): Remove module/mes/read-32-0 dependency.
Do not build $(OUT)/mes.mes.
* module/module.make (module/mes/read-0.mo, module/mes/read-0-32.mo,
module/mes/tiny-0-32.mo): Remove targets.
(CLEAN): Do not add them. Neither install $(OUT)/mes.mes.
* .gitignore: Remove exceptions for them.
* make/install.make (install): Do not install them.
* HACKING: Update info about creating module/mes/read-32-0.mo.
* scaffold/mini-mes.c: Remove.
* scaffold/tiny-mes.c: Remove.
* scaffold/cons-mes.c: Remove.
* scaffold/scaffold.make (tiny-mes.libc, tiny-mes.guile, tiny-mes.mes,
mini-mes.libc, mini-mes.guile, mini-mes.mes): Reemove targets.
2017-05-28 14:03:45 +00:00
|
|
|
$(OUT)/$(1:.c=.$(CROSS)o): $(OUT)/mes
|
2017-05-22 19:15:58 +00:00
|
|
|
$(OUT)/$(1:.c=.$(CROSS)o): scripts/mes
|
2017-05-21 20:25:02 +00:00
|
|
|
$(OUT)/$(1:.c=.$(CROSS)o): $(INSTALL_MES_FILES)
|
|
|
|
$(OUT)/$(1:.c=.$(CROSS)o): $(1)
|
|
|
|
@echo " $$(cc) $$(notdir $(1)) -> $$(notdir $$@)"
|
|
|
|
@mkdir -p $$(dir $$@)
|
|
|
|
$$(QUIET)$$(COMPILE.c) $$(OUTPUT_OPTION) $(1)
|
|
|
|
endef
|
|
|
|
|
2017-05-22 19:15:58 +00:00
|
|
|
define mescc.mes-c-preprocess
|
|
|
|
$(OUT)/$(1:.c=.$(CROSS)E): CROSS:=$(CROSS)
|
|
|
|
$(OUT)/$(1:.c=.$(CROSS)E): cc:=MESCC.mes
|
|
|
|
$(OUT)/$(1:.c=.$(CROSS)E): CC:=$(MESCC.mes)
|
|
|
|
$(OUT)/$(1:.c=.$(CROSS)E): CPPFLAGS:=$(2:%=-D %) $(3:%=-I %)
|
core: Always include reader.c, drop binary read-0-32.mo dependency.
* module/language/c99/compiler.mes (c99-input->full-ast): Remove
obsolete __NYACC__ and MES_FULL defines.
* src/mes.c [!MES_FULL]: Include reader-mes.h.
(mes_builtins) [!MES_FULL]: Include reader.mes.i, reader.me.environment.i.
[!MES_FULL]: Include reader.c.
(main) [!MES_FULL]: By default call load_env, only call bload_env
when --load is supplied. WAS: Always bload read-0-32.mo.
* src/reader.c (__end_of__mes_): Remove.
(dump): Remove option of dumping tiny test program.
* make/mescc-mes.make ($(OUT)/$(TARGET), mescc.mes-ccompile,
mescc.mes.c-compile-E): Depend on $(OUT)/mes, scripts/mes.
* src/src.make (mes.guile): Remove module/mes/read-32-0 dependency.
Do not build $(OUT)/mes.mes.
* module/module.make (module/mes/read-0.mo, module/mes/read-0-32.mo,
module/mes/tiny-0-32.mo): Remove targets.
(CLEAN): Do not add them. Neither install $(OUT)/mes.mes.
* .gitignore: Remove exceptions for them.
* make/install.make (install): Do not install them.
* HACKING: Update info about creating module/mes/read-32-0.mo.
* scaffold/mini-mes.c: Remove.
* scaffold/tiny-mes.c: Remove.
* scaffold/cons-mes.c: Remove.
* scaffold/scaffold.make (tiny-mes.libc, tiny-mes.guile, tiny-mes.mes,
mini-mes.libc, mini-mes.guile, mini-mes.mes): Reemove targets.
2017-05-28 14:03:45 +00:00
|
|
|
$(OUT)/$(1:.c=.$(CROSS)E): OUT:=$(OUT)
|
2017-05-22 19:15:58 +00:00
|
|
|
$(OUT)/$(1:.c=.$(CROSS)E): PREPROCESS.c:=$(MESCC.mes) -E $(CPPFLAGS)
|
|
|
|
$(OUT)/$(1:.c=.$(CROSS)E): $(MAKEFILE_LIST)
|
core: Always include reader.c, drop binary read-0-32.mo dependency.
* module/language/c99/compiler.mes (c99-input->full-ast): Remove
obsolete __NYACC__ and MES_FULL defines.
* src/mes.c [!MES_FULL]: Include reader-mes.h.
(mes_builtins) [!MES_FULL]: Include reader.mes.i, reader.me.environment.i.
[!MES_FULL]: Include reader.c.
(main) [!MES_FULL]: By default call load_env, only call bload_env
when --load is supplied. WAS: Always bload read-0-32.mo.
* src/reader.c (__end_of__mes_): Remove.
(dump): Remove option of dumping tiny test program.
* make/mescc-mes.make ($(OUT)/$(TARGET), mescc.mes-ccompile,
mescc.mes.c-compile-E): Depend on $(OUT)/mes, scripts/mes.
* src/src.make (mes.guile): Remove module/mes/read-32-0 dependency.
Do not build $(OUT)/mes.mes.
* module/module.make (module/mes/read-0.mo, module/mes/read-0-32.mo,
module/mes/tiny-0-32.mo): Remove targets.
(CLEAN): Do not add them. Neither install $(OUT)/mes.mes.
* .gitignore: Remove exceptions for them.
* make/install.make (install): Do not install them.
* HACKING: Update info about creating module/mes/read-32-0.mo.
* scaffold/mini-mes.c: Remove.
* scaffold/tiny-mes.c: Remove.
* scaffold/cons-mes.c: Remove.
* scaffold/scaffold.make (tiny-mes.libc, tiny-mes.guile, tiny-mes.mes,
mini-mes.libc, mini-mes.guile, mini-mes.mes): Reemove targets.
2017-05-28 14:03:45 +00:00
|
|
|
$(OUT)/$(1:.c=.$(CROSS)E): $(OUT)/mes
|
|
|
|
$(OUT)/$(1:.c=.$(CROSS)E): scripts/mes
|
2017-05-22 19:15:58 +00:00
|
|
|
$(OUT)/$(1:.c=.$(CROSS)E): $(INSTALL_MES_FILES)
|
|
|
|
$(OUT)/$(1:.c=.$(CROSS)E): $(1)
|
|
|
|
@echo " $$(cc) $$(notdir $(1)) -> $$(notdir $$@)"
|
|
|
|
@mkdir -p $$(dir $$@)
|
|
|
|
$$(QUIET)$$(PREPROCESS.c) $$(CPPFLAGS) $$(OUTPUT_OPTION) $(1)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define mescc.mes-c-compile-E
|
|
|
|
$(1:.$(CROSS)E=.$(CROSS)o): CROSS:=$(CROSS)
|
|
|
|
$(1:.$(CROSS)E=.$(CROSS)o): cc:=MESCC.mes
|
|
|
|
$(1:.$(CROSS)E=.$(CROSS)o): CC:=$(MESCC.mes)
|
|
|
|
$(1:.$(CROSS)E=.$(CROSS)o): CPPFLAGS:=$(2:%=-D %) $(3:%=-I %)
|
|
|
|
$(1:.$(CROSS)E=.$(CROSS)o): COMPILE.c:=$(MESCC.mes) -c $(CPPFLAGS)
|
core: Always include reader.c, drop binary read-0-32.mo dependency.
* module/language/c99/compiler.mes (c99-input->full-ast): Remove
obsolete __NYACC__ and MES_FULL defines.
* src/mes.c [!MES_FULL]: Include reader-mes.h.
(mes_builtins) [!MES_FULL]: Include reader.mes.i, reader.me.environment.i.
[!MES_FULL]: Include reader.c.
(main) [!MES_FULL]: By default call load_env, only call bload_env
when --load is supplied. WAS: Always bload read-0-32.mo.
* src/reader.c (__end_of__mes_): Remove.
(dump): Remove option of dumping tiny test program.
* make/mescc-mes.make ($(OUT)/$(TARGET), mescc.mes-ccompile,
mescc.mes.c-compile-E): Depend on $(OUT)/mes, scripts/mes.
* src/src.make (mes.guile): Remove module/mes/read-32-0 dependency.
Do not build $(OUT)/mes.mes.
* module/module.make (module/mes/read-0.mo, module/mes/read-0-32.mo,
module/mes/tiny-0-32.mo): Remove targets.
(CLEAN): Do not add them. Neither install $(OUT)/mes.mes.
* .gitignore: Remove exceptions for them.
* make/install.make (install): Do not install them.
* HACKING: Update info about creating module/mes/read-32-0.mo.
* scaffold/mini-mes.c: Remove.
* scaffold/tiny-mes.c: Remove.
* scaffold/cons-mes.c: Remove.
* scaffold/scaffold.make (tiny-mes.libc, tiny-mes.guile, tiny-mes.mes,
mini-mes.libc, mini-mes.guile, mini-mes.mes): Reemove targets.
2017-05-28 14:03:45 +00:00
|
|
|
$(1:.$(CROSS)E=.$(CROSS)o): OUT:=$(OUT)
|
2017-05-22 19:15:58 +00:00
|
|
|
$(1:.$(CROSS)E=.$(CROSS)o): $(MAKEFILE_LIST)
|
core: Always include reader.c, drop binary read-0-32.mo dependency.
* module/language/c99/compiler.mes (c99-input->full-ast): Remove
obsolete __NYACC__ and MES_FULL defines.
* src/mes.c [!MES_FULL]: Include reader-mes.h.
(mes_builtins) [!MES_FULL]: Include reader.mes.i, reader.me.environment.i.
[!MES_FULL]: Include reader.c.
(main) [!MES_FULL]: By default call load_env, only call bload_env
when --load is supplied. WAS: Always bload read-0-32.mo.
* src/reader.c (__end_of__mes_): Remove.
(dump): Remove option of dumping tiny test program.
* make/mescc-mes.make ($(OUT)/$(TARGET), mescc.mes-ccompile,
mescc.mes.c-compile-E): Depend on $(OUT)/mes, scripts/mes.
* src/src.make (mes.guile): Remove module/mes/read-32-0 dependency.
Do not build $(OUT)/mes.mes.
* module/module.make (module/mes/read-0.mo, module/mes/read-0-32.mo,
module/mes/tiny-0-32.mo): Remove targets.
(CLEAN): Do not add them. Neither install $(OUT)/mes.mes.
* .gitignore: Remove exceptions for them.
* make/install.make (install): Do not install them.
* HACKING: Update info about creating module/mes/read-32-0.mo.
* scaffold/mini-mes.c: Remove.
* scaffold/tiny-mes.c: Remove.
* scaffold/cons-mes.c: Remove.
* scaffold/scaffold.make (tiny-mes.libc, tiny-mes.guile, tiny-mes.mes,
mini-mes.libc, mini-mes.guile, mini-mes.mes): Reemove targets.
2017-05-28 14:03:45 +00:00
|
|
|
$(1:.$(CROSS)E=.$(CROSS)o): $(OUT)/mes
|
2017-05-22 19:15:58 +00:00
|
|
|
$(1:.$(CROSS)E=.$(CROSS)o): scripts/mes
|
|
|
|
$(1:.$(CROSS)E=.$(CROSS)o): $(INSTALL_MES_FILES)
|
|
|
|
$(1:.$(CROSS)E=.$(CROSS)o): $(1)
|
|
|
|
@echo " $$(cc) $$(notdir $(1)) -> $$(notdir $$@)"
|
|
|
|
@mkdir -p $$(dir $$@)
|
|
|
|
$$(QUIET)$$(COMPILE.c) $$(CPPFLAGS) $$(OUTPUT_OPTION) $(1)
|
|
|
|
endef
|
|
|
|
|
2017-05-21 20:25:02 +00:00
|
|
|
ifeq ($(MLIBC.mes),)
|
|
|
|
MLIBC.mes:=DONE
|
|
|
|
else
|
2017-06-03 10:11:57 +00:00
|
|
|
C_FILES:=$(filter-out mlibc/libc-mes.c,$(C_FILES))
|
2017-04-12 19:27:59 +00:00
|
|
|
endif
|
2017-05-21 20:25:02 +00:00
|
|
|
|
2017-05-22 19:15:58 +00:00
|
|
|
ifneq ($(MESC_DIRECT),)
|
2017-05-21 20:25:02 +00:00
|
|
|
$(foreach c-file,$(strip $(filter %.c,$(C_FILES))),$(eval $(call mescc.mes-c-compile,$(c-file),$(DEFINES),$(INCLUDES))))
|
2017-05-22 19:15:58 +00:00
|
|
|
else
|
|
|
|
$(foreach c-file,$(strip $(filter %.c,$(C_FILES))),$(eval $(call mescc.mes-c-preprocess,$(c-file),$(DEFINES),$(INCLUDES))))
|
|
|
|
$(foreach c-file,$(strip $(filter %.c,$(C_FILES))),$(eval $(call mescc.mes-c-compile-E,$(c-file:%.c=$(OUT)/%.$(CROSS)E),$(DEFINES),$(INCLUDES))))
|
|
|
|
endif
|
2017-05-21 20:25:02 +00:00
|
|
|
|
2017-05-28 16:32:53 +00:00
|
|
|
endif
|
2017-04-12 19:27:59 +00:00
|
|
|
include make/reset.make
|