[ -- get configs local configs = import("configs") assert(configs) -- the custom script function add(a, b) return a + b end ] project: console { # the modes modes: debug { symbols: debug warnings: all optimize: none cxflags: -fsanitize=address -ftrapv } modes: release { strip: all symbols: hidden cflags: -Wno-error=deprecated-declarations warnings: all optimize: smallest vectorexts: sse2, ssse3, mmx } modes: profile { symbols: debug warnings: none optimize: fastest } target: hello1 { kind: static files: src/hello1/*.c } target: hello2 { kind: shared files: $(projectdir)/src/hello2/*.c } target: hello3 { kind: static files: src/hello3/*.c headers: src/hello3/*.h headerdir: $(buildir)/inc targetdir: $(buildir)/lib objectdir: $(buildir)/obj } target: demo_c { kind: binary deps: hello1 files: src/demo/*.c links: hello1 linkdirs: $(buildir) includedirs: $(buildir) cflags: -DHELLO1 # the modes modes: release { defines: NDEBUG } } target: demo_cpp { kind: binary deps: hello2 files: src/demo/*.cpp version: 1.0.1 configfile: $(buildir)/demo_cpp.h linkdirs: $(buildir) includedirs: $(buildir) switches: AAA_ENABLE switches: CCC_ENABLE switches: FFF_ENABLE, KKK_ENABLE switchfiles: plat/demo_cpp.xswf undefines: HELLO2 cxxflags: -DHELLO1 , [_if (AAA_ENABLE, "-DAAA")] , [_if (BBB_ENABLE, "-DBBB")] , [_if (CCC_ENABLE, "-DCCC")] , [_ifelse (DDD_ENABLE, "-DDDD", "-DEEE")] , [_ifelse (KKK_ENABLE, "-DKKK", "-DFFF")] } platforms: macosx, ios { target: demo_objc { kind: binary deps: hello3 files: src/demo/*.m links: hello3 linkdirs: $(buildir)/lib includedirs: $(buildir)/inc mflags: -DHELLO3, -DPLAT="macosx", -DARCH='armv7, arm64', -DVERSION=[add(1, 2)] } target: demo_objcpp { kind: binary deps: hello3 files: src/demo/*.mm mxflags: -DHELLO3 ldflags: -L$(buildir)/lib, -lhello3, -lhello3 platforms: ios { ldflags: -framework Cocoa, "-framework IOKit" , -framework CoreFoundation } } } }