Update the Makefile to support cross builds.
This commit is contained in:
parent
edd7a60d3c
commit
f41e93b267
29
Makefile
29
Makefile
|
@ -1,10 +1,25 @@
|
||||||
# CC, EXT, and BUILD may be overridden by a top level makefile (e.g. for
|
# cross compilation scheme taken from Eric Smith's spin2cpp compiler
|
||||||
# cross compiling)
|
# if CROSS is defined, we are building a cross compiler
|
||||||
CC = gcc
|
# possible targets are: win32, rpi
|
||||||
EXT =
|
|
||||||
BUILD = ./obj
|
|
||||||
|
|
||||||
TARGET = spinsim$(EXT)
|
ifeq ($(CROSS),win32)
|
||||||
|
CC=i586-mingw32msvc-gcc
|
||||||
|
CXX=i586-mingw32msvc-g++
|
||||||
|
EXT=.exe
|
||||||
|
BUILD=./build-win32
|
||||||
|
else ifeq ($(CROSS),rpi)
|
||||||
|
CC=arm-linux-gnueabihf-gcc
|
||||||
|
CXX=arm-linux-gnueabihf-g++
|
||||||
|
EXT=
|
||||||
|
BUILD=./build-rpi
|
||||||
|
else
|
||||||
|
CC=gcc
|
||||||
|
CXX=g++
|
||||||
|
EXT=
|
||||||
|
BUILD=./build
|
||||||
|
endif
|
||||||
|
|
||||||
|
TARGET = $(BUILD)/spinsim$(EXT)
|
||||||
|
|
||||||
SOURCES = spinsim.c spininterp.c spindebug.c pasmsim.c pasmdebug.c pasmsim2.c pasmdebug2.c eeprom.c debug.c gdb.c
|
SOURCES = spinsim.c spininterp.c spindebug.c pasmsim.c pasmdebug.c pasmsim2.c pasmdebug2.c eeprom.c debug.c gdb.c
|
||||||
|
|
||||||
|
@ -32,5 +47,5 @@ $(BUILD)/%.o: %.c
|
||||||
$(CC) $(CFLAGS) $< -o $@
|
$(CC) $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
clean: FORCE
|
clean: FORCE
|
||||||
rm -f *.o $(TARGET)
|
rm -f $(BUILD)
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
Loading…
Reference in New Issue