X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=Makefile;h=33c2de1b19a2f877ecebf461fc42442a26eb6398;hb=c599f4f4d705ba215a2672b92baa1c29d9dd0735;hp=7250e1e657e73253eff3e205f7f55d4124c31d41;hpb=90d77722511ad5e9b748f69f42c5b2a8467fa049;p=musl diff --git a/Makefile b/Makefile index 7250e1e6..33c2de1b 100644 --- a/Makefile +++ b/Makefile @@ -90,8 +90,16 @@ $(OPTIMIZE_SRCS:%.c=%.o) $(OPTIMIZE_SRCS:%.c=%.lo): CFLAGS += -O3 MEMOPS_SRCS = src/string/memcpy.c src/string/memmove.c src/string/memcmp.c src/string/memset.c $(MEMOPS_SRCS:%.c=%.o) $(MEMOPS_SRCS:%.c=%.lo): CFLAGS += $(CFLAGS_MEMOPS) -%.o: $(ARCH)$(ASMSUBARCH)/%.s - $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $< +# This incantation ensures that changes to any subarch asm files will +# force the corresponding object file to be rebuilt, even if the implicit +# rule below goes indirectly through a .sub file. +define mkasmdep +$(dir $(patsubst %/,%,$(dir $(1))))$(notdir $(1:.s=.o)): $(1) +endef +$(foreach s,$(wildcard src/*/$(ARCH)*/*.s),$(eval $(call mkasmdep,$(s)))) + +%.o: $(ARCH)$(ASMSUBARCH)/%.sub + $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $(dir $<)$(shell cat $<) %.o: $(ARCH)/%.s $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $< @@ -99,6 +107,9 @@ $(MEMOPS_SRCS:%.c=%.o) $(MEMOPS_SRCS:%.c=%.lo): CFLAGS += $(CFLAGS_MEMOPS) %.o: %.c $(GENH) $(IMPH) $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $< +%.lo: $(ARCH)$(ASMSUBARCH)/%.sub + $(CC) $(CFLAGS_ALL_SHARED) -c -o $@ $(dir $<)$(shell cat $<) + %.lo: $(ARCH)/%.s $(CC) $(CFLAGS_ALL_SHARED) -c -o $@ $<