mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-28 12:57:57 +00:00
piegen: Allow to compile piegen tool in cross environment
To build piegen tool with different compiler/linker than gcc/ld -- simply run make as HOSTCC="host-compiler" HOSTLD="host-ld" make where host-compiler/ld is appropriate program needed. https://github.com/xemul/criu/issues/63 Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Reviewed-by: Christopher Covington <cov@codeaurora.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
a755ece2f0
commit
3ffad59e2e
13
Makefile
13
Makefile
@ -32,8 +32,15 @@ NM := $(CROSS_COMPILE)nm
|
|||||||
SH := bash
|
SH := bash
|
||||||
MAKE := make
|
MAKE := make
|
||||||
OBJCOPY := $(CROSS_COMPILE)objcopy
|
OBJCOPY := $(CROSS_COMPILE)objcopy
|
||||||
|
HOSTCC ?= gcc
|
||||||
|
HOSTLD ?= ld
|
||||||
|
|
||||||
CFLAGS += $(USERCFLAGS)
|
CFLAGS += $(USERCFLAGS)
|
||||||
|
HOSTCFLAGS ?= $(CFLAGS)
|
||||||
|
|
||||||
|
export HOSTCC
|
||||||
|
export HOSTLD
|
||||||
|
export HOSTCFLAGS
|
||||||
|
|
||||||
#
|
#
|
||||||
# Fetch ARCH from the uname if not yet set
|
# Fetch ARCH from the uname if not yet set
|
||||||
@ -209,12 +216,12 @@ $(ARCH_DIR): protobuf config
|
|||||||
|
|
||||||
ifeq ($(piegen-y),y)
|
ifeq ($(piegen-y),y)
|
||||||
pie/piegen/%: config
|
pie/piegen/%: config
|
||||||
$(Q) $(MAKE) $(build)=pie/piegen $@
|
$(Q) CC=$(HOSTCC) LD=$(HOSTLD) CFLAGS="$(HOSTCFLAGS)" $(MAKE) $(build)=pie/piegen $@
|
||||||
pie/piegen: config
|
pie/piegen: config
|
||||||
$(Q) $(MAKE) $(build)=pie/piegen all
|
$(Q) CC=$(HOSTCC) LD=$(HOSTLD) CFLAGS="$(HOSTCFLAGS)" $(MAKE) $(build)=pie/piegen all
|
||||||
$(piegen): pie/piegen/built-in.o
|
$(piegen): pie/piegen/built-in.o
|
||||||
$(E) " LINK " $@
|
$(E) " LINK " $@
|
||||||
$(Q) $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
|
$(Q) $(HOSTCC) $(HOSTCFLAGS) $^ $(LDFLAGS) -o $@
|
||||||
.PHONY: pie/piegen
|
.PHONY: pie/piegen
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user