diff options
| author | Jon <[email protected]> | 2012-05-02 20:46:09 -0400 |
|---|---|---|
| committer | Jon <[email protected]> | 2012-05-22 10:50:28 -0400 |
| commit | 9f89da6eef2c830db6fc3abb08fe755ae7ce9b6c (patch) | |
| tree | d1feb367d93853b5f05ce2bbed2171a561631b31 /Makefile | |
| parent | b5dcb7128d7d235b66b4d9be879d26364dd1e3e9 (diff) | |
| download | mruby-9f89da6eef2c830db6fc3abb08fe755ae7ce9b6c.tar.gz mruby-9f89da6eef2c830db6fc3abb08fe755ae7ce9b6c.zip | |
Add native and cross compiling CMake build support
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..fc22089a9 --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +# makefile discription. +# basic build file for mruby + +# compiler, linker (gcc) +CC = gcc +LL = gcc +DEBUG_MODE = 1 +ifeq ($(DEBUG_MODE),1) +CFLAGS = -g -O3 +else +CFLAGS = -O3 +endif +ALL_CFLAGS = -Wall -Werror-implicit-function-declaration $(CFLAGS) +ifeq ($(OS),Windows_NT) + MAKE_FLAGS = --no-print-directory CC=$(CC) LL=$(LL) ALL_CFLAGS='$(ALL_CFLAGS)' +else + MAKE_FLAGS = --no-print-directory CC='$(CC)' LL='$(LL)' ALL_CFLAGS='$(ALL_CFLAGS)' +endif + +############################## +# generic build targets, rules + +.PHONY : all +all : + @$(MAKE) -C src $(MAKE_FLAGS) + @$(MAKE) -C mrblib $(MAKE_FLAGS) + @$(MAKE) -C tools/mruby $(MAKE_FLAGS) + @$(MAKE) -C tools/mirb $(MAKE_FLAGS) + +# mruby test +.PHONY : test +test : all + @$(MAKE) -C test $(MAKE_FLAGS) + +# clean up +.PHONY : clean +clean : + @$(MAKE) clean -C src $(MAKE_FLAGS) + @$(MAKE) clean -C tools/mruby $(MAKE_FLAGS) + @$(MAKE) clean -C tools/mirb $(MAKE_FLAGS) + @$(MAKE) clean -C test $(MAKE_FLAGS) |
