Browse Source

Tested and documented cross compile strategy.

Thomas Davis 12 years ago
parent
commit
51719a5d81
2 changed files with 12 additions and 5 deletions
  1. 5 2
      build/Makefile.in-os
  2. 7 3
      docs/Building.md

+ 5 - 2
build/Makefile.in-os

@@ -3,9 +3,11 @@
 # License http://opensource.org/licenses/mit-license.php MIT License
 #
 
-ifeq ($(OS),Windows_NT)
+# Override this using TARGET_OS=LINUX on the command line
+ifeq ($(TARGET_OS),)
+  ifeq ($(OS),Windows_NT)
     TARGET_OS = WIN32
-else
+  else
     UNAME_S := $(shell uname -s)
     ifeq ($(UNAME_S),Linux)
         TARGET_OS = LINUX
@@ -16,4 +18,5 @@ else
             TARGET_OS = BSD
         endif
     endif
+  endif
 endif

+ 7 - 3
docs/Building.md

@@ -75,13 +75,17 @@ make build COPT="-DNDEBUG -DNO_CGI"
 | NO_SSL                    | disable SSL functionality            |
 | NO_SSL_DL                 | link against system libssl library   |
 
-## Advanced Cross Compiling
+## Cross Compiling
+
+Take total control with *CC*, *COPTS* and *TARGET_OS* as make options.
+TARGET_OS is used to determine some compile details as will as code function.
+TARGET_OS values should be be one found in *build/Makefile.in-os*.
 
-Take total control with *CC* and *CFLAGS* as make options.
 ```
-make build CC="mycc" CFLAGS="-gprof -DNDEBUG -DNO_CGI"
+make CC=arm-none-linux-gnueabi-gcc COPT="-march=armv7-a  -mfpu=vfp -mfloat-abi=softfp" TARGET_OS=FROG
 ```
 
+
 ## Cocoa DMG Packaging (OSX Only)
 
 Use the alternate *Makefile.osx* to do the build.  The entire build has