1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-28 00:30:12 +00:00

Added compatibility with cmd.exe (and reduced verbosity).

This commit is contained in:
Oliver Schmidt 2013-05-05 22:33:25 +02:00
parent 88648ce717
commit 1591871ba7

View File

@ -35,6 +35,16 @@ ifeq ($(words $(MAKECMDGOALS)),1)
endif endif
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: .SUFFIXES:
.PHONY: all $(TARGETS) mostlyclean clean .PHONY: all $(TARGETS) mostlyclean clean
@ -47,10 +57,10 @@ $(TARGETS):
@$(MAKE) --no-print-directory $@ @$(MAKE) --no-print-directory $@
mostlyclean: mostlyclean:
$(RM) -r ../wrk $(call RMDIR,../wrk)
clean: mostlyclean clean:
$(RM) -r ../lib $(addprefix ../,$(DRVTYPES)) $(call RMDIR,../wrk ../lib $(addprefix ../,$(DRVTYPES)))
else # TARGET else # TARGET
@ -145,18 +155,20 @@ $1_STCS = $$(patsubst $$($1_DRVPAT),$$($1_STCPAT),$$($1_DRVS))
$$($1_OBJS): | $$($1_OBJDIR) $$($1_OBJS): | $$($1_OBJDIR)
$$($1_OBJDIR): $$($1_OBJDIR):
mkdir -p $$@ @$$(call MKDIR,$$@)
$$($1_DRVPAT): $$($1_OBJPAT) $$(ZPOBJ) | $$($1_DRVDIR) $$($1_DRVPAT): $$($1_OBJPAT) $$(ZPOBJ) | $$($1_DRVDIR)
$$(LD) -o $$@ -t module $$^ @echo $$(TARGET) - $$(@F)
@$$(LD) -o $$@ -t module $$^
$$($1_DRVDIR): $$($1_DRVDIR):
mkdir $$@ @$$(call MKDIR,$$@)
$(TARGET): $$($1_DRVS) $(TARGET): $$($1_DRVS)
$$($1_STCPAT): $$($1_DRVPAT) $$($1_STCPAT): $$($1_DRVPAT)
$$(CO) -o $$(@:.o=.s) --code-label _$$(subst -,_,$$(subst .,_,$$(<F))) $$< @echo $$(TARGET) - $$(<F)
@$$(CO) -o $$(@:.o=.s) --code-label _$$(subst -,_,$$(subst .,_,$$(<F))) $$<
@$$(CA) -t $$(TARGET) -o $$@ $$(@:.o=.s) @$$(CA) -t $$(TARGET) -o $$@ $$(@:.o=.s)
OBJS += $$($1_STCS) OBJS += $$($1_STCS)
@ -184,20 +196,22 @@ else
endif endif
../wrk/$(TARGET)/%.o: %.s | ../wrk/$(TARGET) ../wrk/$(TARGET)/%.o: %.s | ../wrk/$(TARGET)
$(CA) -t $(TARGET) $(AFLAGS) --create-dep $(@:.o=.d) -o $@ $< @echo $(TARGET) - $<
@$(CA) -t $(TARGET) $(AFLAGS) --create-dep $(@:.o=.d) -o $@ $<
../wrk/$(TARGET)/%.o: %.c | ../wrk/$(TARGET) ../wrk/$(TARGET)/%.o: %.c | ../wrk/$(TARGET)
$(CC) -t $(TARGET) $(CFLAGS) --create-dep $(@:.o=.d) -o $(@:.o=.s) $< @echo $(TARGET) - $<
@$(CC) -t $(TARGET) $(CFLAGS) --create-dep $(@:.o=.d) -o $(@:.o=.s) $<
@$(CA) -t $(TARGET) -o $@ $(@:.o=.s) @$(CA) -t $(TARGET) -o $@ $(@:.o=.s)
../wrk/$(TARGET): ../wrk/$(TARGET):
mkdir -p $@ @$(call MKDIR,$@)
../lib/$(TARGET).lib: $(OBJS) | ../lib ../lib/$(TARGET).lib: $(OBJS) | ../lib
$(AR) a $@ $? $(AR) a $@ $?
../lib: ../lib:
mkdir $@ @$(call MKDIR,$@)
$(TARGET): ../lib/$(TARGET).lib $(TARGET): ../lib/$(TARGET).lib