forked from Imagelibrary/binutils-gdb
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.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2021-03-13 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* Make-common.in (COMPILE_FOR_BUILD, LINK_FOR_BUILD): Define.
|
||||
(gentmap.o): New rule.
|
||||
(gentmap): Call LINK_FOR_BUILD.
|
||||
|
||||
2021-03-07 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* Make-common.in (check): Delete body.
|
||||
|
||||
@@ -248,6 +248,9 @@ EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL) $(LIBIBERTY_LIB) \
|
||||
|
||||
LIB_OBJS = callback.o syscall.o targ-map.o version.o $(SIM_OBJS)
|
||||
|
||||
COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS)
|
||||
LINK_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@
|
||||
|
||||
RUNTESTFLAGS =
|
||||
|
||||
callback_h = $(srcroot)/include/gdb/callback.h
|
||||
@@ -269,8 +272,11 @@ run$(EXEEXT): $(SIM_RUN_OBJS) libsim.a $(LIBDEPS)
|
||||
# devo/libremote because this directory would contain more than just
|
||||
# a library).
|
||||
|
||||
gentmap: Makefile $(srccom)/gentmap.c $(srccom)/nltvals.def
|
||||
$(CC_FOR_BUILD) $(srccom)/gentmap.c -o gentmap $(BUILD_CFLAGS) $(NL_TARGET)
|
||||
gentmap.o: Makefile $(srccom)/gentmap.c $(srccom)/nltvals.def
|
||||
$(COMPILE_FOR_BUILD) -o $@ -c $(srccom)/gentmap.c $(NL_TARGET)
|
||||
|
||||
gentmap: gentmap.o
|
||||
$(LINK_FOR_BUILD) $<
|
||||
|
||||
targ-vals.h targ-map.c: stamp-tvals
|
||||
stamp-tvals: gentmap
|
||||
|
||||
Reference in New Issue
Block a user