mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
Makefile: RISCV support and optional vars
Optional variables are needed because the structure of the makefile is prepared to run on Guix but Guix doesn't support RISCV yet, so it's better to set them as optional and let the user decide how do they want to compile this thing.
This commit is contained in:
parent
41a2a60fa1
commit
23c4e36dca
1 changed files with 11 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
TESTS=$(sort $(basename $(wildcard *.c)))
|
||||
TARGETS ?= native ia32 aarch64 armv7
|
||||
TESTS ?= $(sort $(basename $(wildcard *.c)))
|
||||
TARGETS ?= native ia32 aarch64 armv7 riscv
|
||||
|
||||
# Suitable values of cross-compiler variables for Debian:
|
||||
#
|
||||
|
@ -17,10 +17,11 @@ TARGETS ?= native ia32 aarch64 armv7
|
|||
# gcc-aarch64-linux-gnu libc6-dev-arm64-cross libc6:arm64
|
||||
#
|
||||
CC = gcc
|
||||
CC_IA32=guix environment --pure -s i686-linux --ad-hoc gcc-toolchain -- gcc
|
||||
CC_AARCH64=guix environment --pure -s aarch64-linux --ad-hoc gcc-toolchain -- gcc
|
||||
CC_ARMv7=guix environment --pure -s armhf-linux --ad-hoc gcc-toolchain -- gcc
|
||||
CFLAGS = -Wall -O0 -g
|
||||
CC_IA32 ?= guix environment --pure -s i686-linux --ad-hoc gcc-toolchain -- gcc
|
||||
CC_AARCH64 ?= guix environment --pure -s aarch64-linux --ad-hoc gcc-toolchain -- gcc
|
||||
CC_ARMv7 ?= guix environment --pure -s armhf-linux --ad-hoc gcc-toolchain -- gcc
|
||||
CC_RISCV ?= guix environment --pure -s riscv64-linux --ad-hoc gcc-toolchain -- gcc
|
||||
CFLAGS ?= -Wall -O0 -g
|
||||
|
||||
all: $(foreach TARGET,$(TARGETS),$(addprefix test-$(TARGET)-,$(TESTS)))
|
||||
|
||||
|
@ -54,6 +55,10 @@ test-armv7-%: CC = $(CC_ARMv7)
|
|||
test-armv7-%: %.c lightening-armv7.o test.h
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I.. -o $@ lightening-armv7.o $<
|
||||
|
||||
test-riscv-%: CC = $(CC_RISCV)
|
||||
test-riscv-%: %.c lightening-riscv.o test.h
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I.. -o $@ lightening-riscv.o $<
|
||||
|
||||
.PRECIOUS: $(foreach TARGET,$(TARGETS),$(addprefix test-$(TARGET)-,$(TESTS)))
|
||||
.PRECIOUS: $(foreach TARGET,$(TARGETS),lightening-$(TARGET).o)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue