From: Oliver Schmidt Date: Sun, 5 May 2013 20:33:25 +0000 (+0200) Subject: Added compatibility with cmd.exe (and reduced verbosity). X-Git-Tag: V2.14~25 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1591871ba7182d049176581e46efe5c13b28366c;p=cc65 Added compatibility with cmd.exe (and reduced verbosity). --- 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 .,_,$$(