Change the default compiler of the extensions from the fixed gcc to $(CC) passed in by the upper layer Makefile, to facilitate cross_compile.
Signed-off-by: jianyun.gao <[email protected]> --- Makefile | 2 +- extensions/Makefile | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index b277129..58b1326 100644 --- a/Makefile +++ b/Makefile @@ -727,7 +727,7 @@ extensions: make_configure @$(MAKE) do_extensions do_extensions: - @$(MAKE) -C extensions -i TARGET=$(TARGET) TARGET_CFLAGS="$(CFLAGS) $(TARGET_CFLAGS)" GDB=$(GDB) GDB_FLAGS=$(GDB_FLAGS) + @$(MAKE) -C extensions -i CC=$(CC) TARGET=$(TARGET) TARGET_CFLAGS="$(CFLAGS) $(TARGET_CFLAGS)" GDB=$(GDB) GDB_FLAGS=$(GDB_FLAGS) memory_driver: make_configure @$(MAKE) -C memory_driver -i diff --git a/extensions/Makefile b/extensions/Makefile index e4c68c3..67d3839 100644 --- a/extensions/Makefile +++ b/extensions/Makefile @@ -23,7 +23,7 @@ # suffice, create a .mk file with the same prefix as the .c file, # and that makefile will be invoked. # - +CC ?= gcc CONTRIB_SO := $(patsubst %.c,%.so,$(wildcard *.c)) all: link_defs $(CONTRIB_SO) @@ -37,11 +37,11 @@ $(CONTRIB_SO): %.so: %.c defs.h $(MAKE) -f $*.mk; \ else \ grep -q '((constructor))' $*.c && { \ - echo "gcc -Wall -g -shared -rdynamic -o $@ $*.c -fPIC -D$(TARGET) $(TARGET_CFLAGS) $(GDB_FLAGS)"; \ - gcc -Wall -g -shared -rdynamic -o $@ $*.c -fPIC -D$(TARGET) $(TARGET_CFLAGS) $(GDB_FLAGS); \ + echo "$(CC) -Wall -g -shared -rdynamic -o $@ $*.c -fPIC -D$(TARGET) $(TARGET_CFLAGS) $(GDB_FLAGS)"; \ + $(CC) -Wall -g -shared -rdynamic -o $@ $*.c -fPIC -D$(TARGET) $(TARGET_CFLAGS) $(GDB_FLAGS); \ } || { \ - echo "gcc -Wall -g -nostartfiles -shared -rdynamic -o $@ $*.c -fPIC -D$(TARGET) $(TARGET_CFLAGS) $(GDB_FLAGS)"; \ - gcc -Wall -g -nostartfiles -shared -rdynamic -o $@ $*.c -fPIC -D$(TARGET) $(TARGET_CFLAGS) $(GDB_FLAGS); \ + echo "$(CC) -Wall -g -nostartfiles -shared -rdynamic -o $@ $*.c -fPIC -D$(TARGET) $(TARGET_CFLAGS) $(GDB_FLAGS)"; \ + $(CC) -Wall -g -nostartfiles -shared -rdynamic -o $@ $*.c -fPIC -D$(TARGET) $(TARGET_CFLAGS) $(GDB_FLAGS); \ }; \ fi -- 2.34.1
-- Crash-utility mailing list -- [email protected] To unsubscribe send an email to [email protected] https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/ Contribution Guidelines: https://github.com/crash-utility/crash/wiki
