From eaea38e0f23f13de295449a7297cb615401efe94 Mon Sep 17 00:00:00 2001 From: zouboan Date: Thu, 10 Nov 2022 21:04:59 +0800 Subject: [PATCH] libc and mm/Makefile:Fix an error caused by backslash in Windows native build libc and mm/Makefile:Fix an error caused by backslash in Windows native build --- libs/libc/Makefile | 18 ++++++++++-------- mm/Makefile | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/libs/libc/Makefile b/libs/libc/Makefile index 466d71a06d..17d628b469 100644 --- a/libs/libc/Makefile +++ b/libs/libc/Makefile @@ -114,8 +114,8 @@ endif BINDIR ?= bin -AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS)) -COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS)) +AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT), $(ASRCS)) +COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT), $(CSRCS)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) @@ -126,10 +126,12 @@ BIN ?= libc$(LIBEXT) all: $(BIN) .PHONY: clean distclean -$(AOBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.S +$(AOBJS): $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) -$(COBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.c +# REVISIT: Backslash causes problems in $(COBJS) target + +$(COBJS): $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT): %.c $(call COMPILE, $<, $@) # C library for the flat build and @@ -194,9 +196,9 @@ distclean:: clean $(Q) $(MAKE) -C kbin distclean $(Q) $(MAKE) -C zoneinfo distclean BIN=$(BIN) $(call DELFILE, exec_symtab.c) - $(call DELFILE, bin/Make.dep) - $(call DELFILE, kbin/Make.dep) + $(call DELFILE, bin$(DELIM)Make.dep) + $(call DELFILE, kbin$(DELIM)Make.dep) $(call DELFILE, .depend) --include bin/Make.dep --include kbin/Make.dep +-include bin$(DELIM)Make.dep +-include kbin$(DELIM)Make.dep diff --git a/mm/Makefile b/mm/Makefile index f58f7efc0d..1d1d5f2413 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -37,8 +37,8 @@ BINDIR ?= bin CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)mm -AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS)) -COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS)) +AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT), $(ASRCS)) +COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT), $(CSRCS)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) @@ -49,10 +49,12 @@ BIN ?= libmm$(LIBEXT) all: $(BIN) .PHONY: clean distclean -$(AOBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.S +$(AOBJS): $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) -$(COBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.c +# REVISIT: Backslash causes problems in $(COBJS) target + +$(COBJS): $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT): %.c $(call COMPILE, $<, $@) # Memory manager for the flat build and @@ -101,9 +103,9 @@ clean: distclean: clean $(Q) $(MAKE) -C bin distclean $(Q) $(MAKE) -C kbin distclean - $(call DELFILE, bin/Make.dep) - $(call DELFILE, kbin/Make.dep) + $(call DELFILE, bin$(DELIM)Make.dep) + $(call DELFILE, kbin$(DELIM)Make.dep) $(call DELFILE, .depend) --include bin/Make.dep --include kbin/Make.dep +-include bin$(DELIM)Make.dep +-include kbin$(DELIM)Make.dep