diff --git a/Makefile b/Makefile index d597c21..2b66b12 100644 --- a/Makefile +++ b/Makefile @@ -90,31 +90,36 @@ BRIGHT_WHITE = \033[97m BG_BRIGHT_WHITE = \033[107m RESET = \033[0m +ECHO_E = echo -e +ifeq ($(KERNEL), Darwin) + ECHO_E = echo +endif + all: clean builddir codegen run-c-test full run-cc-test help: - @echo -e "$(BOLD)$(BLUE)Available build variables:$(RESET)" - @echo -e " $(GREEN)CC$(RESET) C compiler to use $(YELLOW)(Default: clang)$(RESET)." - @echo -e " $(GREEN)CXX$(RESET) C++ compiler to use $(YELLOW)(Default: clang++)$(RESET)." - @echo -e " $(GREEN)AR$(RESET) Archiving utility to use for building static libraries $(YELLOW)(Default: ar)$(RESET)." - @echo -e " $(GREEN)BUILD_TYPE$(RESET) Build type $(MAGENTA)[Debug | RelWithDebInfo | Release] $(YELLOW)(Default: Debug)$(RESET)." - @echo -e " $(GREEN)BUILD_DIR$(RESET) Directory where build files will be written." - @echo -e " $(GREEN)INSTALL_PREFIX$(RESET) Prefix where library and include files will be installed." - @echo -e " $(GREEN)CODEGEN_INPUT$(RESET) Input file for code generation (See $(CYAN)codegen_custom_data_example.json$(RESET) for an example)." - @echo -e " $(GREEN)RUNTIME_ASSERT$(RESET) Whether runtime asserts are enabled $(MAGENTA)[true | false] $(YELLOW)(Default: true)$(RESET)." - @echo -e " $(GREEN)$(RESET) $(BOLD)$(BG_BRIGHT_RED)DISCLAIMER:$(RESET) Using this flag is not recommended as it disables safety checks" - @echo -e " $(GREEN)$(RESET) potentially leading to Undefined Behaviour." - @echo - @echo -e "$(BOLD)$(BLUE)Available targets:$(RESET)" - @echo -e " $(GREEN)make$(RESET) Build, install and test the full wapp library." - @echo -e " $(GREEN)make full$(RESET) Build and install the full wapp library." - @echo -e " $(GREEN)make core$(RESET) Build and install only the $(CYAN)core$(RESET) component of the wapp library with all its dependencies." - @echo -e " $(GREEN)make prng$(RESET) Build and install only the $(CYAN)prng$(RESET) component of the wapp library with all its dependencies." - @echo -e " $(GREEN)make uuid$(RESET) Build and install only the $(CYAN)uuid$(RESET) component of the wapp library with all its dependencies." - @echo -e " $(GREEN)make testing$(RESET) Build and install only the $(CYAN)testing$(RESET) component of the wapp library with all its dependencies." - @echo -e " $(GREEN)make primitives$(RESET) Build and install only the $(CYAN)primitives$(RESET) component of the wapp library with all its dependencies." - @echo -e " $(GREEN)make clean$(RESET) Clean the build directory." - @echo -e " $(GREEN)make help$(RESET) Print this help message and exit." + @$(ECHO_E) "$(BOLD)$(BLUE)Available build variables:$(RESET)" + @$(ECHO_E) " $(GREEN)CC$(RESET) C compiler to use $(YELLOW)(Default: clang)$(RESET)." + @$(ECHO_E) " $(GREEN)CXX$(RESET) C++ compiler to use $(YELLOW)(Default: clang++)$(RESET)." + @$(ECHO_E) " $(GREEN)AR$(RESET) Archiving utility to use for building static libraries $(YELLOW)(Default: ar)$(RESET)." + @$(ECHO_E) " $(GREEN)BUILD_TYPE$(RESET) Build type $(MAGENTA)[Debug | RelWithDebInfo | Release] $(YELLOW)(Default: Debug)$(RESET)." + @$(ECHO_E) " $(GREEN)BUILD_DIR$(RESET) Directory where build files will be written." + @$(ECHO_E) " $(GREEN)INSTALL_PREFIX$(RESET) Prefix where library and include files will be installed." + @$(ECHO_E) " $(GREEN)CODEGEN_INPUT$(RESET) Input file for code generation (See $(CYAN)codegen_custom_data_example.json$(RESET) for an example)." + @$(ECHO_E) " $(GREEN)RUNTIME_ASSERT$(RESET) Whether runtime asserts are enabled $(MAGENTA)[true | false] $(YELLOW)(Default: true)$(RESET)." + @$(ECHO_E) " $(GREEN)$(RESET) $(BOLD)$(BG_RED)DISCLAIMER:$(RESET) Using this flag is not recommended as it disables safety checks" + @$(ECHO_E) " $(GREEN)$(RESET) potentially leading to Undefined Behaviour." + @$(ECHO_E) + @$(ECHO_E) "$(BOLD)$(BLUE)Available targets:$(RESET)" + @$(ECHO_E) " $(GREEN)make$(RESET) Build, install and test the full wapp library." + @$(ECHO_E) " $(GREEN)make full$(RESET) Build and install the full wapp library." + @$(ECHO_E) " $(GREEN)make core$(RESET) Build and install only the $(CYAN)core$(RESET) component of the wapp library with all its dependencies." + @$(ECHO_E) " $(GREEN)make prng$(RESET) Build and install only the $(CYAN)prng$(RESET) component of the wapp library with all its dependencies." + @$(ECHO_E) " $(GREEN)make uuid$(RESET) Build and install only the $(CYAN)uuid$(RESET) component of the wapp library with all its dependencies." + @$(ECHO_E) " $(GREEN)make testing$(RESET) Build and install only the $(CYAN)testing$(RESET) component of the wapp library with all its dependencies." + @$(ECHO_E) " $(GREEN)make primitives$(RESET) Build and install only the $(CYAN)primitives$(RESET) component of the wapp library with all its dependencies." + @$(ECHO_E) " $(GREEN)make clean$(RESET) Clean the build directory." + @$(ECHO_E) " $(GREEN)make help$(RESET) Print this help message and exit." full: LIB_SRC = src/wapp.c full: INCLUDES = common core primitives prng testing uuid