Skip to content

Commit

Permalink
Add make make OS_ID=0.n.m for building other platforms. See my blog.
Browse files Browse the repository at this point in the history
  • Loading branch information
carls committed Dec 26, 2012
1 parent 32752b8 commit 3a1b847
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 16 deletions.
21 changes: 14 additions & 7 deletions make/makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# REBOL Makefile -- Generated by make-make.r (do not edit) on 24-Dec-2012/15:28:24-8:00
# REBOL Makefile -- Generated by make-make.r (do not edit) on 26-Dec-2012/12:30:23-8:00
# This makefile is intentional kept simple to make builds possible on
# a wider range of target platforms.

# To cross compile or build for other target:
# To regenerate this file:
# make make

# To generate this file for a different platform, check systems.r file
# and provide an OS_ID (from the systems table). Linux 2.5 for example:
# make make OS_ID=0.4.3

# To cross compile using a different toolchain and include files:
# $TOOLS - should point to bin where gcc is found
# $INCL - should point to the dir for includes
# Example make:
Expand Down Expand Up @@ -30,12 +37,12 @@ R= $S/core
INCL ?= .
I= -I$(INCL) -I$S/include/

TO_OS= TO_LINUX
OS_ID= 0.4.4
BIN_SUFFIX=
RAPI_FLAGS= -O2 -fvisibility=hidden -m32
TO_OS?= TO_LINUX
OS_ID?= 0.4.4
BIN_SUFFIX=
RAPI_FLAGS= -O2 -fvisibility=hidden -m32
HOST_FLAGS= -DREB_EXE -O2 -fvisibility=hidden -m32 -D_FILE_OFFSET_BITS=64
RLIB_FLAGS=
RLIB_FLAGS=

# Flags for core and for host:
RFLAGS= -c -D$(TO_OS) -DREB_API $(RAPI_FLAGS) $I
Expand Down
32 changes: 23 additions & 9 deletions src/tools/make-make.r
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@ path-incl: %../../src/include/

;******************************************************************************

; (Warning: format is a bit sensitive to extra spacing. E.g. see macro+ func)

makefile-head:

{# REBOL Makefile -- Generated by make-make.r (do not edit) on !date
# This makefile is intentional kept simple to make builds possible on
# a wider range of target platforms.
# To cross compile or build for other target:
# To regenerate this file:
# make make
# To generate this file for a different platform, check systems.r file
# and provide an OS_ID (from the systems table). Linux 2.5 for example:
# make make OS_ID=0.4.3
# To cross compile using a different toolchain and include files:
# $TOOLS - should point to bin where gcc is found
# $INCL - should point to the dir for includes
# Example make:
Expand Down Expand Up @@ -62,12 +71,12 @@ R= $S/core
INCL ?= .
I= -I$(INCL) -I$S/include/
TO_OS=
OS_ID=
BIN_SUFFIX=
RAPI_FLAGS=
TO_OS?=
OS_ID?=
BIN_SUFFIX=
RAPI_FLAGS=
HOST_FLAGS= -DREB_EXE
RLIB_FLAGS=
RLIB_FLAGS=
# Flags for core and for host:
RFLAGS= -c -D$(TO_OS) -DREB_API $(RAPI_FLAGS) $I
Expand Down Expand Up @@ -267,10 +276,15 @@ macro+: func [
"Appends value to end of macro= line"
'name
value
/local str
][
name: find find/tail makefile-head join newline join name "=" newline
if name/-1 != space [name: insert name space]
insert name value
; (this should use parse!)
str: any [
find find/tail makefile-head join newline join name "=" newline
find find/tail makefile-head join newline join name "?=" newline
]
unless str [print ajoin ["Cannot find " name "= definition"] exit]
insert insert str space value
]

macro++: funct ['name obj [object!]] [
Expand Down

0 comments on commit 3a1b847

Please sign in to comment.