From 1591871ba7182d049176581e46efe5c13b28366c Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Sun, 5 May 2013 22:33:25 +0200
Subject: [PATCH] Added compatibility with cmd.exe (and reduced verbosity).
---
libsrc/Makefile | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/libsrc/Makefile b/libsrc/Makefile
index f10bebec2..39a5e497e 100644
--- a/libsrc/Makefile
+++ b/libsrc/Makefile
@@ -35,6 +35,16 @@ ifeq ($(words $(MAKECMDGOALS)),1)
endif
endif
+DIRLIST = $(strip $(foreach dir,$1,$(wildcard $(dir))))
+
+ifeq ($(shell echo),)
+ MKDIR = mkdir -p $1
+ RMDIR = $(RM) -r $1
+else
+ MKDIR = mkdir $(subst /,\,$1)
+ RMDIR = $(if $(DIRLIST),rmdir /s /q $(subst /,\,$(DIRLIST)))
+endif
+
.SUFFIXES:
.PHONY: all $(TARGETS) mostlyclean clean
@@ -47,10 +57,10 @@ $(TARGETS):
@$(MAKE) --no-print-directory $@
mostlyclean:
- $(RM) -r ../wrk
+ $(call RMDIR,../wrk)
-clean: mostlyclean
- $(RM) -r ../lib $(addprefix ../,$(DRVTYPES))
+clean:
+ $(call RMDIR,../wrk ../lib $(addprefix ../,$(DRVTYPES)))
else # TARGET
@@ -145,18 +155,20 @@ $1_STCS = $$(patsubst $$($1_DRVPAT),$$($1_STCPAT),$$($1_DRVS))
$$($1_OBJS): | $$($1_OBJDIR)
$$($1_OBJDIR):
- mkdir -p $$@
+ @$$(call MKDIR,$$@)
$$($1_DRVPAT): $$($1_OBJPAT) $$(ZPOBJ) | $$($1_DRVDIR)
- $$(LD) -o $$@ -t module $$^
+ @echo $$(TARGET) - $$(@F)
+ @$$(LD) -o $$@ -t module $$^
$$($1_DRVDIR):
- mkdir $$@
+ @$$(call MKDIR,$$@)
$(TARGET): $$($1_DRVS)
$$($1_STCPAT): $$($1_DRVPAT)
- $$(CO) -o $$(@:.o=.s) --code-label _$$(subst -,_,$$(subst .,_,$$(