remove support for subarch .sub files from the makefile
as of commit af21a82ccc8687aa16e85def7db95efeae4cf72e, .sub files are
no longer in use. removing the makefile machinery to handle them not
only cleans up and simplifies the makefile, but also significantly
reduces make's startup time.
diff --git a/Makefile b/Makefile
index 7f11d63..a451a84 100644
--- a/Makefile
+++ b/Makefile
@@ -19,9 +19,9 @@
BASE_SRCS = $(sort $(wildcard $(srcdir)/src/*/*.c $(srcdir)/arch/$(ARCH)/src/*.[csS]))
BASE_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(BASE_SRCS)))
-ARCH_SRCS = $(wildcard $(srcdir)/src/*/$(ARCH)/*.[csS] $(srcdir)/src/*/$(ARCH)$(ASMSUBARCH)/*.sub)
+ARCH_SRCS = $(wildcard $(srcdir)/src/*/$(ARCH)/*.[csS])
ARCH_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(ARCH_SRCS)))
-REPLACED_OBJS = $(sort $(subst /$(ARCH)$(ASMSUBARCH)/,/,$(subst /$(ARCH)/,/,$(ARCH_OBJS))) $(subst /$(ARCH)$(ASMSUBARCH)/,/$(ARCH)/,$(subst /$(ARCH)/,/,$(ARCH_OBJS))))
+REPLACED_OBJS = $(sort $(subst /$(ARCH)/,/,$(ARCH_OBJS)))
OBJS = $(addprefix obj/, $(filter-out $(REPLACED_OBJS), $(sort $(BASE_OBJS) $(ARCH_OBJS))))
LOBJS = $(OBJS:.o=.lo)
GENH = obj/include/bits/alltypes.h
@@ -128,14 +128,6 @@
$(CRT_LIBS:lib/%=obj/crt/%): CFLAGS_ALL += -DCRT
-# 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
-$(patsubst $(srcdir)/%,obj/%,$(dir $(patsubst %/,%,$(dir $(1))))$(ARCH)$(ASMSUBARCH)/$(notdir $(1:.s=.o))): $(1)
-endef
-$(foreach s,$(wildcard $(srcdir)/src/*/$(ARCH)*/*.s),$(eval $(call mkasmdep,$(s))))
-
$(LOBJS): CFLAGS_ALL += -fPIC -DSHARED
# Choose invocation of assembler to be used
@@ -146,9 +138,6 @@
AS_CMD = $(CC) $(CFLAGS_ALL) -c -o $@ $<
endif
-obj/%.o: $(srcdir)/%.sub
- $(CC) $(CFLAGS_ALL) -c -o $@ $(dir $<)$$(cat $<)
-
obj/%.o: $(srcdir)/%.s
$(AS_CMD) $(CFLAGS_ALL)
@@ -158,9 +147,6 @@
obj/%.o: $(srcdir)/%.c $(GENH) $(IMPH)
$(CC) $(CFLAGS_ALL) -c -o $@ $<
-obj/%.lo: $(srcdir)/%.sub
- $(CC) $(CFLAGS_ALL) -c -o $@ $(dir $<)$$(cat $<)
-
obj/%.lo: $(srcdir)/%.s
$(AS_CMD) $(CFLAGS_ALL)