ref: 1cadf696ffc0ca4b5de516477435b6df197194cb
parent: ca44f53e072e0a0eea376a5f7a7ddfe754ccc184
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Oct 26 14:19:11 EDT 2021
libmach: Simplify the Makefile We can get rid of the object list generation using a hand written list of objects.
--- a/src/libmach/.gitignore
+++ /dev/null
@@ -1,1 +1,0 @@
-objlst.mk
--- a/src/libmach/Makefile
+++ b/src/libmach/Makefile
@@ -9,36 +9,56 @@
TARGET = $(LIBDIR)/scc/libmach.a
+all: $(TARGET)
+
OBJS =\
+ archive.o\
+ armember.o\
+ delobj.o\
+ findsec.o\
+ getindex.o\
+ getsec.o\
+ getsym.o\
+ loadmap.o\
mach.o\
+ newmap.o\
newobj.o \
- delobj.o\
+ newobj.o\
objpos.o\
- archive.o\
- armember.o\
objtype.o\
+ pack.o\
+ pc2line.o\
readobj.o\
- writeobj.o\
- getsym.o\
- getsec.o\
rebase.o\
- loadmap.o\
- newmap.o\
+ setindex.o\
setmap.o\
- findsec.o\
strip.o\
- pc2line.o\
- pack.o\
unpack.o\
- setindex.o\
- getindex.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\
+all: $(TARGET)
-all: $(OBJS) $(DIRS) objlst.mk
- +@$(MAKE) -f Makefile.mach
+$(OBJS): $(DIRS)
-objlst.mk: $(OBJS) $(DIRS)
- ./mklst $@
+$(TARGET): $(OBJS)
+ $(AR) $(PROJ_ARFLAGS) $@ $?
+ $(RL) $(PROJ_RLFLAGS) $@
clean:
rm -f $(TBLS) objlst.mk
--- a/src/libmach/Makefile.mach
+++ /dev/null
@@ -1,12 +1,0 @@
-.POSIX:
-PROJECTDIR =../..
-include $(PROJECTDIR)/scripts/rules.mk
-include objlst.mk
-
-TARGET = $(LIBDIR)/scc/libmach.a
-
-all: $(TARGET)
-
-$(TARGET): $(OBJS)
- $(AR) $(PROJ_ARFLAGS) $@ $?
- $(RL) $(PROJ_RLFLAGS) $@
--- a/src/libmach/mklst
+++ /dev/null
@@ -1,9 +1,0 @@
-#!/bin/sh
-
-set -e
-
-rm -f $1
-trap 'r=$?;rm -f $$.tmp;exit $r' HUP EXIT QUIT TERM
-
-(echo OBJS=\\
- find . -name '*.o' | sed 's/$/\\/') > $$.tmp && mv $$.tmp $1