2
0
Fork 0
original-tara/Makefile

56 lines
1.1 KiB
Makefile
Raw Normal View History

2018-11-22 21:14:43 +00:00
#
# Single top level makefile
#
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
MODULES := $(call rwildcard, src, */0module.mk)
MODULES_LIB := $(call rwildcard, src, */0module.lib.mk)
-include build/make/local.inc.mk
include build/make/env.inc.mk
include $(MODULES_LIB)
include $(MODULES)
.PHONY: all
all:
@echo TODO: All is build.
.PHONY: test
test:
@echo TODO: Testing
.PHONY: clean
clean:
@echo === Cleaning
@test $(PATH_BIN) && $(RM) -r $(PATH_BIN);
define mod_mkdir
@echo === Create module build folder.
$(MKDIR) $(1)
endef
define mod_compile_asm
@echo === Compile module asm.
$(SDASM) $(SDASM_FLAGS) -I$(LIBASM_SRC)/include $(1) $(2)
endef
define mod_link_asm_lib
@echo === Link module asm lib.
$(SDAR) $(SDAR_FLAGS) $(1) $(2)
endef
define mod_link_asm_dos
@echo === Link module asm dos.
$(SDCC) $(SDCC_FLAG_CPU) --no-std-crt0 --code-loc 0x0100 -o $(1) $(2)
endef
#-l$(LIBASM_LINK)
define mod_hex2com
@echo === Convert to binary
cd $(dir $(1)) && $(H2B) -e com $(notdir $(1));
@sha1sum $(2);
@echo === Done $(notdir $(2))
endef