ref: 844cf5ff2aa2a862b58d2e503e02534e133ad395
parent: 90255b74b5ee876abaae5adc6105721a897fe678
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Oct 26 17:55:31 EDT 2021
libmach: Remove recursive Makefile It did not make sense after the last change where the script mklst was removed. At this point is just better to keep a single list of objects and do everything from the top level Makefile.
--- a/src/libmach/Makefile
+++ b/src/libmach/Makefile
@@ -1,11 +1,9 @@
.POSIX:
-DIRS =\
- coff32\
- elf64\
-
PROJECTDIR =../..
include $(PROJECTDIR)/scripts/rules.mk
+include coff32/rules.mk
+include elf64/rules.mk
TARGET = $(LIBDIR)/scc/libmach.a
@@ -35,27 +33,10 @@
strip.o\
unpack.o\
writeobj.o\
- coff32/coff32.o\
- coff32/coff32del.o\
- coff32/coff32getidx.o\
- coff32/coff32getsec.o\
- coff32/coff32getsym.o\
- coff32/coff32loadmap.o\
- coff32/coff32new.o\
- coff32/coff32pc2line.o\
- coff32/coff32probe.o\
- coff32/coff32read.o\
- coff32/coff32setidx.o\
- coff32/coff32strip.o\
- coff32/coff32write.o\
- coff32/coff32xgetidx.o\
- coff32/coff32xsetidx.o\
- elf64/elf64.o\
- elf64/elf64new.o\
+ $(COFF32_OBJS)\
+ $(ELF64_OBJS)\
all: $(TARGET)
-
-$(OBJS): $(DIRS)
$(TARGET): $(OBJS)
$(AR) $(PROJ_ARFLAGS) $@ $?
--- a/src/libmach/coff32/Makefile
+++ /dev/null
@@ -1,27 +1,0 @@
-.POSIX:
-
-PROJECTDIR =../../..
-include $(PROJECTDIR)/scripts/rules.mk
-
-OBJS =\
- coff32.o \
- coff32del.o \
- coff32new.o \
- coff32probe.o \
- coff32read.o \
- coff32strip.o \
- coff32write.o \
- coff32setidx.o \
- coff32xsetidx.o \
- coff32getidx.o \
- coff32xgetidx.o \
- coff32setidx.o \
- coff32getidx.o \
- coff32pc2line.o \
- coff32getsym.o \
- coff32getsec.o \
- coff32loadmap.o\
-
-all: $(OBJS)
-
-include deps.mk
--- a/src/libmach/coff32/deps.mk
+++ /dev/null
@@ -1,45 +1,0 @@
-#deps
-coff32.o: $(INCDIR)/scc/scc/mach.h
-coff32.o: ../libmach.h
-coff32.o: coff32.h
-coff32del.o: $(INCDIR)/scc/scc/mach.h
-coff32del.o: ../libmach.h
-coff32del.o: coff32.h
-coff32getidx.o: $(INCDIR)/scc/scc/mach.h
-coff32getidx.o: ../libmach.h
-coff32getidx.o: coff32.h
-coff32getsec.o: $(INCDIR)/scc/scc/mach.h
-coff32getsec.o: ../libmach.h
-coff32getsec.o: coff32.h
-coff32getsym.o: $(INCDIR)/scc/scc/mach.h
-coff32getsym.o: ../libmach.h
-coff32getsym.o: coff32.h
-coff32loadmap.o: $(INCDIR)/scc/scc/mach.h
-coff32loadmap.o: ../libmach.h
-coff32loadmap.o: coff32.h
-coff32new.o: $(INCDIR)/scc/scc/mach.h
-coff32new.o: ../libmach.h
-coff32new.o: coff32.h
-coff32pc2line.o: $(INCDIR)/scc/scc/mach.h
-coff32pc2line.o: ../libmach.h
-coff32probe.o: $(INCDIR)/scc/scc/mach.h
-coff32probe.o: ../libmach.h
-coff32probe.o: coff32.h
-coff32read.o: $(INCDIR)/scc/scc/mach.h
-coff32read.o: ../libmach.h
-coff32read.o: coff32.h
-coff32setidx.o: $(INCDIR)/scc/scc/mach.h
-coff32setidx.o: ../libmach.h
-coff32setidx.o: coff32.h
-coff32strip.o: $(INCDIR)/scc/scc/mach.h
-coff32strip.o: ../libmach.h
-coff32strip.o: coff32.h
-coff32write.o: $(INCDIR)/scc/scc/mach.h
-coff32write.o: ../libmach.h
-coff32write.o: coff32.h
-coff32xgetidx.o: $(INCDIR)/scc/scc/cstd.h
-coff32xgetidx.o: $(INCDIR)/scc/scc/mach.h
-coff32xgetidx.o: ../libmach.h
-coff32xgetidx.o: coff32.h
-coff32xsetidx.o: $(INCDIR)/scc/scc/mach.h
-coff32xsetidx.o: ../libmach.h
--- /dev/null
+++ b/src/libmach/coff32/rules.mk
@@ -1,0 +1,18 @@
+COFF32_OBJS =\
+ coff32/coff32.o \
+ coff32/coff32del.o \
+ coff32/coff32new.o \
+ coff32/coff32probe.o \
+ coff32/coff32read.o \
+ coff32/coff32strip.o \
+ coff32/coff32write.o \
+ coff32/coff32setidx.o \
+ coff32/coff32xsetidx.o \
+ coff32/coff32getidx.o \
+ coff32/coff32xgetidx.o \
+ coff32/coff32setidx.o \
+ coff32/coff32getidx.o \
+ coff32/coff32pc2line.o \
+ coff32/coff32getsym.o \
+ coff32/coff32getsec.o \
+ coff32/coff32loadmap.o\
--- a/src/libmach/deps.mk
+++ b/src/libmach/deps.mk
@@ -50,6 +50,12 @@
coff32/coff32xsetidx.o: coff32/../libmach.h
delobj.o: $(INCDIR)/scc/scc/mach.h
delobj.o: libmach.h
+elf64/elf64.o: $(INCDIR)/scc/scc/mach.h
+elf64/elf64.o: elf64/../libmach.h
+elf64/elf64.o: elf64/elf64.h
+elf64/elf64new.o: $(INCDIR)/scc/scc/mach.h
+elf64/elf64new.o: elf64/../libmach.h
+elf64/elf64new.o: elf64/elf64.h
findsec.o: $(INCDIR)/scc/scc/mach.h
findsec.o: libmach.h
getindex.o: $(INCDIR)/scc/scc/mach.h
--- a/src/libmach/elf64/Makefile
+++ /dev/null
@@ -1,12 +1,0 @@
-.POSIX:
-
-PROJECTDIR =../../..
-include $(PROJECTDIR)/scripts/rules.mk
-
-OBJS =\
- elf64.o \
- elf64new.o\
-
-all: $(OBJS)
-
-include deps.mk
--- a/src/libmach/elf64/deps.mk
+++ /dev/null
@@ -1,7 +1,0 @@
-#deps
-elf64.o: $(INCDIR)/scc/scc/mach.h
-elf64.o: ../libmach.h
-elf64.o: elf64.h
-elf64new.o: $(INCDIR)/scc/scc/mach.h
-elf64new.o: ../libmach.h
-elf64new.o: elf64.h
--- /dev/null
+++ b/src/libmach/elf64/rules.mk
@@ -1,0 +1,3 @@
+ELF64_OBJS =\
+ elf64/elf64.o \
+ elf64/elf64new.o\