ecsv  committed 18efb9c

Add CROSS_COMPILE make option

The CROSS_COMPILE make option can be used to automatically prepend the prefix
to all build relevant tools to seamlessly allow cross compilation without
setting each tool name separately.

Cross compiling for MinGW32 would can be done using
$ make -C projects/unix/ CROSS_COMPILE=i686-pc-mingw32- HOST_CPU=i686 UNAME=MINGW

  • Participants
  • Parent commits 5b08d29
  • Branches default

Comments (0)

Files changed (1)

File projects/unix/Makefile

 # default configuration programs
-SDL_CONFIG ?= sdl-config
-PKG_CONFIG ?= pkg-config
 ifeq ($(CPU), X86)
   CFLAGS += -msse
 # set base program pointers and flags
-CC       ?= gcc
-CXX      ?= g++
+CC        = $(CROSS_COMPILE)gcc
+CXX       = $(CROSS_COMPILE)g++
 RM       ?= rm -f
 INSTALL  ?= install
 MKDIR ?= mkdir -p