summaryrefslogtreecommitdiff
path: root/mbld/mk/myr.mk
diff options
context:
space:
mode:
Diffstat (limited to 'mbld/mk/myr.mk')
-rw-r--r--mbld/mk/myr.mk42
1 files changed, 42 insertions, 0 deletions
diff --git a/mbld/mk/myr.mk b/mbld/mk/myr.mk
new file mode 100644
index 0000000..68e4c41
--- /dev/null
+++ b/mbld/mk/myr.mk
@@ -0,0 +1,42 @@
+ifneq ($(MYRLIB),)
+ _LIBNAME=lib$(MYRLIB).a
+endif
+
+all: $(_LIBNAME) $(MYRBIN)
+
+$(_LIBNAME): $(MYRSRC) $(ASMSRC)
+ myrbuild -l $(MYRLIB) $^
+
+$(MYRBIN): $(MYRSRC) $(ASMSRC)
+ myrbuild -b $(MYRBIN) $^
+
+OBJ=$(MYRSRC:.myr=.o) $(ASMSRC:.s=.o)
+JUNKASM=$(MYRSRC:.myr=.s)
+USE=$(MYRSRC:.myr=.use) $(MYRLIB)
+.PHONY: clean install install-bin install-lib
+clean:
+ rm -f $(OBJ)
+ rm -f $(USE)
+ rm -f $(JUNKASM) $(CLEANEXTRA)
+ rm -f $(_LIBNAME) $(MYRBIN)
+
+install: install-bin install-lib
+
+install-bin: $(MYRBIN)
+ @if [ ! -z "$(MYRBIN)" ]; then \
+ echo install $(MYRBIN) $(INST_ROOT)/bin; \
+ mkdir -p $(INST_ROOT)/bin; \
+ install $(MYRBIN) $(INST_ROOT)/bin; \
+ fi
+
+install-lib: $(_LIBNAME)
+ @if [ ! -z "$(_LIBNAME)" ]; then \
+ echo install -m 644 $(_LIBNAME) $(INST_ROOT)/lib/myr; \
+ echo install -m 644 $(MYRLIB) $(INST_ROOT)/lib/myr; \
+ mkdir -p $(INST_ROOT)/lib/myr; \
+ install -m 644 $(_LIBNAME) $(INST_ROOT)/lib/myr; \
+ install -m 644 $(MYRLIB) $(INST_ROOT)/lib/myr; \
+ fi
+
+config.mk:
+ ./configure