aboutsummaryrefslogtreecommitdiff
path: root/sim/igen
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-03-08 01:41:35 -0500
committerMike Frysinger <vapier@gentoo.org>2021-03-13 11:15:46 -0500
commitc6c7769d9dd166c45bd9d422e91ca537752c0382 (patch)
tree487321af5a03f0644e8d22048484d642b54a5bf8 /sim/igen
parent367c5eb75095f4b9bc4c1b310a092bcac45da137 (diff)
downloadgdb-c6c7769d9dd166c45bd9d422e91ca537752c0382.zip
gdb-c6c7769d9dd166c45bd9d422e91ca537752c0382.tar.gz
gdb-c6c7769d9dd166c45bd9d422e91ca537752c0382.tar.bz2
sim: introduce {COMPILE,LINK}_FOR_BUILD
These use the same pattern as seen in the opcodes/ dir and in automake in general (ish). This helps simplify the boilerplate for building and linking build-time code, and fixes some inconsistency in flag usage. For rules that were compiling+linking in a single step, split them into separate steps so we can apply the correct set of options. This matches automake behavior too.
Diffstat (limited to 'sim/igen')
-rw-r--r--sim/igen/ChangeLog7
-rw-r--r--sim/igen/Makefile.in21
2 files changed, 19 insertions, 9 deletions
diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog
index 2d647c4..5ee1c7a 100644
--- a/sim/igen/ChangeLog
+++ b/sim/igen/ChangeLog
@@ -1,3 +1,10 @@
+2021-03-13 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (COMPILE_FOR_BUILD, LINK_FOR_BUILD): Define.
+ (.c.o, igen.o): Call COMPILE_FOR_BUILD.
+ (igen, tmp-table, tmp-filter, tmp-ld-decode, tmp-ld-cache, tmp-ld-insn,
+ tmp-gen): Call LINK_FOR_BUILD.
+
2021-03-08 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (tmp-table, tmp-filter, tmp-ld-decode, tmp-ld-cache,
diff --git a/sim/igen/Makefile.in b/sim/igen/Makefile.in
index 5976c4c..60626ad 100644
--- a/sim/igen/Makefile.in
+++ b/sim/igen/Makefile.in
@@ -82,11 +82,14 @@ BUILD_CFLAGS = \
$(INCLUDES)
BUILD_LDFLAGS =
+COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS)
+LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(BUILD_LDFLAGS) -o $@
+
all: igen
#all: tmp-filter tmp-table tmp-ld-insn tmp-ld-cache tmp-ld-decode tmp-gen
.c.o:
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $<
+ $(COMPILE_FOR_BUILD) -c $<
IGEN_OBJS=\
table.o \
@@ -106,28 +109,28 @@ IGEN_OBJS=\
gen.o
igen: igen.o $(IGEN_OBJS)
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o igen igen.o $(IGEN_OBJS)
+ $(LINK_FOR_BUILD) igen.o $(IGEN_OBJS)
igen.o: igen.c misc.h filter_host.h lf.h table.h ld-decode.h ld-cache.h ld-insn.h filter.h gen-model.h gen-itable.h gen-icache.h gen-idecode.h gen-engine.h gen-semantics.h gen-support.h gen.h igen.h
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/igen.c
+ $(COMPILE_FOR_BUILD) -c $(srcdir)/igen.c
tmp-table: table.c table.h misc.o lf.o filter_host.o
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-table -DMAIN $(srcdir)/table.c misc.o lf.o filter_host.o
+ $(LINK_FOR_BUILD) -DMAIN $(srcdir)/table.c misc.o lf.o filter_host.o
tmp-filter: filter.c filter.h lf.o misc.o filter_host.o
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-filter -DMAIN $(srcdir)/filter.c lf.o misc.o filter_host.o
+ $(LINK_FOR_BUILD) -DMAIN $(srcdir)/filter.c lf.o misc.o filter_host.o
tmp-ld-decode: ld-decode.h ld-decode.c filter.o misc.o lf.o table.o filter_host.o gen.h igen.h
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-ld-decode -DMAIN $(srcdir)/ld-decode.c filter.o misc.o lf.o table.o filter_host.o
+ $(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-decode.c filter.o misc.o lf.o table.o filter_host.o
tmp-ld-cache: ld-cache.c ld-cache.h ld-insn.o misc.o lf.o table.o filter_host.o gen.h igen.h
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-ld-cache -DMAIN $(srcdir)/ld-cache.c ld-insn.o filter.o misc.o lf.o table.o filter_host.o
+ $(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-cache.c ld-insn.o filter.o misc.o lf.o table.o filter_host.o
tmp-ld-insn: ld-insn.c ld-insn.h misc.o lf.o table.o filter_host.o filter.o gen.h igen.h
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-ld-insn -DMAIN $(srcdir)/ld-insn.c misc.o lf.o table.o filter_host.o filter.o
+ $(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-insn.c misc.o lf.o table.o filter_host.o filter.o
tmp-gen: gen.c gen.h ld-insn.o ld-decode.o misc.o lf.o table.o filter_host.o filter.o gen.h igen.h
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-gen -DMAIN $(srcdir)/gen.c misc.o ld-insn.o ld-decode.o lf.o table.o filter_host.o filter.o
+ $(LINK_FOR_BUILD) -DMAIN $(srcdir)/gen.c misc.o ld-insn.o ld-decode.o lf.o table.o filter_host.o filter.o
filter_host.o: filter_host.c filter_host.h
table.o: table.c misc.h filter_host.h lf.h table.h