From 2d1501800f91b099d454ccca1f21d70a985dbd97 Mon Sep 17 00:00:00 2001 From: Sander Mertens Date: Sat, 5 Aug 2023 13:55:36 -0700 Subject: [PATCH] Add mingw buildfiles for util --- .../Makefile | 0 .../bake.make | 2 +- drivers/lang/c/build-Darwin/bake_lang_c.make | 12 +- drivers/lang/c/build-Linux/bake_lang_c.make | 4 +- .../lang/c/build-MSYS_NT-10.0-22000/Makefile | 48 ++++ .../build-MSYS_NT-10.0-22000/bake_lang_c.make | 136 +++++++++ drivers/lang/c/premake5.lua | 6 +- drivers/lang/c/run_premake.sh | 3 + .../lang/cpp/build-Darwin/bake_lang_cpp.make | 12 +- .../lang/cpp/build-Linux/bake_lang_cpp.make | 4 +- .../cpp/build-MSYS_NT-10.0-22000/Makefile | 48 ++++ .../bake_lang_cpp.make | 136 +++++++++ drivers/lang/cpp/premake5.lua | 6 +- drivers/lang/cpp/run_premake.sh | 3 + run_premake.sh | 6 +- util/build-Darwin/bake_util.make | 4 +- util/build-Linux/bake_util.make | 4 +- util/build-MSYS_NT-10.0-22000/Makefile | 48 ++++ util/build-MSYS_NT-10.0-22000/bake_util.make | 266 ++++++++++++++++++ util/premake5.lua | 20 +- util/run_premake.sh | 7 +- 21 files changed, 738 insertions(+), 37 deletions(-) rename {build-Mingw => build-MSYS_NT-10.0-22000}/Makefile (100%) rename {build-Mingw => build-MSYS_NT-10.0-22000}/bake.make (99%) create mode 100644 drivers/lang/c/build-MSYS_NT-10.0-22000/Makefile create mode 100644 drivers/lang/c/build-MSYS_NT-10.0-22000/bake_lang_c.make create mode 100644 drivers/lang/cpp/build-MSYS_NT-10.0-22000/Makefile create mode 100644 drivers/lang/cpp/build-MSYS_NT-10.0-22000/bake_lang_cpp.make create mode 100644 util/build-MSYS_NT-10.0-22000/Makefile create mode 100644 util/build-MSYS_NT-10.0-22000/bake_util.make diff --git a/build-Mingw/Makefile b/build-MSYS_NT-10.0-22000/Makefile similarity index 100% rename from build-Mingw/Makefile rename to build-MSYS_NT-10.0-22000/Makefile diff --git a/build-Mingw/bake.make b/build-MSYS_NT-10.0-22000/bake.make similarity index 99% rename from build-Mingw/bake.make rename to build-MSYS_NT-10.0-22000/bake.make index 6b58b40d..839685d1 100644 --- a/build-Mingw/bake.make +++ b/build-MSYS_NT-10.0-22000/bake.make @@ -20,7 +20,7 @@ endif RESCOMP = windres TARGETDIR = .. -TARGET = $(TARGETDIR)/bake +TARGET = $(TARGETDIR)/bake.exe INCLUDES += -I../include -I../util/include FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) diff --git a/drivers/lang/c/build-Darwin/bake_lang_c.make b/drivers/lang/c/build-Darwin/bake_lang_c.make index f6a1e778..9aa8f0d5 100644 --- a/drivers/lang/c/build-Darwin/bake_lang_c.make +++ b/drivers/lang/c/build-Darwin/bake_lang_c.make @@ -26,9 +26,9 @@ ifeq ($(config),debug) DEFINES += -DDEBUG INCLUDES += -I.. -I"$(BAKE_HOME)/include" FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -fPIC -g - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -fPIC -g + ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c99 -D_XOPEN_SOURCE=600 + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c99 -D_XOPEN_SOURCE=600 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += -lbake_util LDDEPS += @@ -61,9 +61,9 @@ ifeq ($(config),release) DEFINES += -DNDEBUG INCLUDES += -I.. -I"$(BAKE_HOME)/include" FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC + ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC -std=c99 -D_XOPEN_SOURCE=600 + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC -std=c99 -D_XOPEN_SOURCE=600 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += -lbake_util LDDEPS += diff --git a/drivers/lang/c/build-Linux/bake_lang_c.make b/drivers/lang/c/build-Linux/bake_lang_c.make index 6ae46b9d..aed36871 100644 --- a/drivers/lang/c/build-Linux/bake_lang_c.make +++ b/drivers/lang/c/build-Linux/bake_lang_c.make @@ -18,7 +18,7 @@ ifeq ($(config),debug) DEFINES += -DDEBUG INCLUDES += -I.. -I"$(BAKE_HOME)/include" FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) + ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c99 -D_XOPEN_SOURCE=600 ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c99 -D_XOPEN_SOURCE=600 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) @@ -45,7 +45,7 @@ ifeq ($(config),release) DEFINES += -DNDEBUG INCLUDES += -I.. -I"$(BAKE_HOME)/include" FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) + ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC -std=c99 -D_XOPEN_SOURCE=600 ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC -std=c99 -D_XOPEN_SOURCE=600 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) diff --git a/drivers/lang/c/build-MSYS_NT-10.0-22000/Makefile b/drivers/lang/c/build-MSYS_NT-10.0-22000/Makefile new file mode 100644 index 00000000..d93bc72a --- /dev/null +++ b/drivers/lang/c/build-MSYS_NT-10.0-22000/Makefile @@ -0,0 +1,48 @@ +# Alternative GNU Make workspace makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +ifeq ($(config),debug) + bake_lang_c_config = debug + +else ifeq ($(config),release) + bake_lang_c_config = release + +else + $(error "invalid configuration $(config)") +endif + +PROJECTS := bake_lang_c + +.PHONY: all clean help $(PROJECTS) + +all: $(PROJECTS) + +bake_lang_c: +ifneq (,$(bake_lang_c_config)) + @echo "==== Building bake_lang_c ($(bake_lang_c_config)) ====" + @${MAKE} --no-print-directory -C . -f bake_lang_c.make config=$(bake_lang_c_config) +endif + +clean: + @${MAKE} --no-print-directory -C . -f bake_lang_c.make clean + +help: + @echo "Usage: make [config=name] [target]" + @echo "" + @echo "CONFIGURATIONS:" + @echo " debug" + @echo " release" + @echo "" + @echo "TARGETS:" + @echo " all (default)" + @echo " clean" + @echo " bake_lang_c" + @echo "" + @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file diff --git a/drivers/lang/c/build-MSYS_NT-10.0-22000/bake_lang_c.make b/drivers/lang/c/build-MSYS_NT-10.0-22000/bake_lang_c.make new file mode 100644 index 00000000..31f53870 --- /dev/null +++ b/drivers/lang/c/build-MSYS_NT-10.0-22000/bake_lang_c.make @@ -0,0 +1,136 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +TARGETDIR = .. +TARGET = $(TARGETDIR)/bake_lang_c.dll +INCLUDES += -I.. -I"$(BAKE_HOME)/include" +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LIBS += -lbake_util +LDDEPS += +LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +ifeq ($(config),debug) +OBJDIR = ../.bake_cache/debug +DEFINES += -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g +ALL_LDFLAGS += $(LDFLAGS) -L"$(BAKE_HOME)/lib" -shared -Wl,--out-implib="../bake_lang_c.lib" + +else ifeq ($(config),release) +OBJDIR = ../.bake_cache/release +DEFINES += -DNDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2 +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2 +ALL_LDFLAGS += $(LDFLAGS) -L"$(BAKE_HOME)/lib" -shared -Wl,--out-implib="../bake_lang_c.lib" -s + +endif + +# Per File Configurations +# ############################################# + + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/main.o +OBJECTS += $(OBJDIR)/main.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking bake_lang_c + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning bake_lang_c +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/main.o: ../src/main.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file diff --git a/drivers/lang/c/premake5.lua b/drivers/lang/c/premake5.lua index b9a34244..a6564f56 100644 --- a/drivers/lang/c/premake5.lua +++ b/drivers/lang/c/premake5.lua @@ -3,7 +3,7 @@ workspace "bake_lang_c" configurations { "debug", "release" } location "build" - configuration { "linux", "gmake" } + filter { "action:gmake" } buildoptions { "-std=c99", "-D_XOPEN_SOURCE=600" } project "bake_lang_c" @@ -20,10 +20,10 @@ workspace "bake_lang_c" links { "bake_util" } libdirs { "$(BAKE_HOME)/lib" } - configuration "debug" + filter "debug" defines { "DEBUG" } symbols "On" - configuration "release" + filter "release" defines { "NDEBUG" } optimize "On" diff --git a/drivers/lang/c/run_premake.sh b/drivers/lang/c/run_premake.sh index 4cbe4bf2..aa4d9e68 100755 --- a/drivers/lang/c/run_premake.sh +++ b/drivers/lang/c/run_premake.sh @@ -1,6 +1,9 @@ rm -rf build-Darwin rm -rf build-Linux +rm -rf build-MSYS_NT-10.0-22000 ../../../../premake5 --os=macosx gmake mv build build-Darwin ../../../../premake5 --os=linux gmake mv build build-Linux +../../../../premake5 --os=windows gmake2 +mv build build-MSYS_NT-10.0-22000 diff --git a/drivers/lang/cpp/build-Darwin/bake_lang_cpp.make b/drivers/lang/cpp/build-Darwin/bake_lang_cpp.make index d4b70b09..e0933c44 100644 --- a/drivers/lang/cpp/build-Darwin/bake_lang_cpp.make +++ b/drivers/lang/cpp/build-Darwin/bake_lang_cpp.make @@ -26,9 +26,9 @@ ifeq ($(config),debug) DEFINES += -DDEBUG INCLUDES += -I.. -I"$(BAKE_HOME)/include" FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -fPIC -g - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -fPIC -g + ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c99 -D_XOPEN_SOURCE=600 + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c99 -D_XOPEN_SOURCE=600 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += -lbake_util LDDEPS += @@ -61,9 +61,9 @@ ifeq ($(config),release) DEFINES += -DNDEBUG INCLUDES += -I.. -I"$(BAKE_HOME)/include" FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC + ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC -std=c99 -D_XOPEN_SOURCE=600 + ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC -std=c99 -D_XOPEN_SOURCE=600 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += -lbake_util LDDEPS += diff --git a/drivers/lang/cpp/build-Linux/bake_lang_cpp.make b/drivers/lang/cpp/build-Linux/bake_lang_cpp.make index 99c44cb8..8a32d3ad 100644 --- a/drivers/lang/cpp/build-Linux/bake_lang_cpp.make +++ b/drivers/lang/cpp/build-Linux/bake_lang_cpp.make @@ -18,7 +18,7 @@ ifeq ($(config),debug) DEFINES += -DDEBUG INCLUDES += -I.. -I"$(BAKE_HOME)/include" FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) + ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c99 -D_XOPEN_SOURCE=600 ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c99 -D_XOPEN_SOURCE=600 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) @@ -45,7 +45,7 @@ ifeq ($(config),release) DEFINES += -DNDEBUG INCLUDES += -I.. -I"$(BAKE_HOME)/include" FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) + ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC -std=c99 -D_XOPEN_SOURCE=600 ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC -std=c99 -D_XOPEN_SOURCE=600 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) diff --git a/drivers/lang/cpp/build-MSYS_NT-10.0-22000/Makefile b/drivers/lang/cpp/build-MSYS_NT-10.0-22000/Makefile new file mode 100644 index 00000000..be19c40e --- /dev/null +++ b/drivers/lang/cpp/build-MSYS_NT-10.0-22000/Makefile @@ -0,0 +1,48 @@ +# Alternative GNU Make workspace makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +ifeq ($(config),debug) + bake_lang_cpp_config = debug + +else ifeq ($(config),release) + bake_lang_cpp_config = release + +else + $(error "invalid configuration $(config)") +endif + +PROJECTS := bake_lang_cpp + +.PHONY: all clean help $(PROJECTS) + +all: $(PROJECTS) + +bake_lang_cpp: +ifneq (,$(bake_lang_cpp_config)) + @echo "==== Building bake_lang_cpp ($(bake_lang_cpp_config)) ====" + @${MAKE} --no-print-directory -C . -f bake_lang_cpp.make config=$(bake_lang_cpp_config) +endif + +clean: + @${MAKE} --no-print-directory -C . -f bake_lang_cpp.make clean + +help: + @echo "Usage: make [config=name] [target]" + @echo "" + @echo "CONFIGURATIONS:" + @echo " debug" + @echo " release" + @echo "" + @echo "TARGETS:" + @echo " all (default)" + @echo " clean" + @echo " bake_lang_cpp" + @echo "" + @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file diff --git a/drivers/lang/cpp/build-MSYS_NT-10.0-22000/bake_lang_cpp.make b/drivers/lang/cpp/build-MSYS_NT-10.0-22000/bake_lang_cpp.make new file mode 100644 index 00000000..b265a937 --- /dev/null +++ b/drivers/lang/cpp/build-MSYS_NT-10.0-22000/bake_lang_cpp.make @@ -0,0 +1,136 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +TARGETDIR = .. +TARGET = $(TARGETDIR)/bake_lang_cpp.dll +INCLUDES += -I.. -I"$(BAKE_HOME)/include" +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LIBS += -lbake_util +LDDEPS += +LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +ifeq ($(config),debug) +OBJDIR = ../.bake_cache/debug +DEFINES += -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g +ALL_LDFLAGS += $(LDFLAGS) -L"$(BAKE_HOME)/lib" -shared -Wl,--out-implib="../bake_lang_cpp.lib" + +else ifeq ($(config),release) +OBJDIR = ../.bake_cache/release +DEFINES += -DNDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2 +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2 +ALL_LDFLAGS += $(LDFLAGS) -L"$(BAKE_HOME)/lib" -shared -Wl,--out-implib="../bake_lang_cpp.lib" -s + +endif + +# Per File Configurations +# ############################################# + + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/main.o +OBJECTS += $(OBJDIR)/main.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking bake_lang_cpp + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning bake_lang_cpp +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/main.o: ../src/main.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file diff --git a/drivers/lang/cpp/premake5.lua b/drivers/lang/cpp/premake5.lua index 2acc4506..e228431b 100644 --- a/drivers/lang/cpp/premake5.lua +++ b/drivers/lang/cpp/premake5.lua @@ -3,7 +3,7 @@ workspace "bake_lang_cpp" configurations { "debug", "release" } location "build" - configuration { "linux", "gmake" } + filter { "action:gmake" } buildoptions { "-std=c99", "-D_XOPEN_SOURCE=600" } project "bake_lang_cpp" @@ -20,10 +20,10 @@ workspace "bake_lang_cpp" links { "bake_util" } libdirs { "$(BAKE_HOME)/lib" } - configuration "debug" + filter "debug" defines { "DEBUG" } symbols "On" - configuration "release" + filter "release" defines { "NDEBUG" } optimize "On" diff --git a/drivers/lang/cpp/run_premake.sh b/drivers/lang/cpp/run_premake.sh index 4cbe4bf2..aa4d9e68 100755 --- a/drivers/lang/cpp/run_premake.sh +++ b/drivers/lang/cpp/run_premake.sh @@ -1,6 +1,9 @@ rm -rf build-Darwin rm -rf build-Linux +rm -rf build-MSYS_NT-10.0-22000 ../../../../premake5 --os=macosx gmake mv build build-Darwin ../../../../premake5 --os=linux gmake mv build build-Linux +../../../../premake5 --os=windows gmake2 +mv build build-MSYS_NT-10.0-22000 diff --git a/run_premake.sh b/run_premake.sh index c6576f96..ac64a82f 100755 --- a/run_premake.sh +++ b/run_premake.sh @@ -1,9 +1,9 @@ rm -rf build-Darwin rm -rf build-Linux -rm -rf build-Mingw +rm -rf build-MSYS_NT-10.0-22000 ../premake5 --os=macosx gmake mv build build-Darwin ../premake5 --os=linux gmake mv build build-Linux -../premake5 --os=linux gmake2 -mv build build-Mingw +../premake5 --os=windows gmake2 +mv build build-MSYS_NT-10.0-22000 diff --git a/util/build-Darwin/bake_util.make b/util/build-Darwin/bake_util.make index 30debd7c..271bc38e 100644 --- a/util/build-Darwin/bake_util.make +++ b/util/build-Darwin/bake_util.make @@ -26,7 +26,7 @@ ifeq ($(config),debug) DEFINES += -DUT_IMPL -DDEBUG INCLUDES += -I.. -I"$(BAKE_HOME)/include" FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) + ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c99 -D_XOPEN_SOURCE=600 ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c99 -D_XOPEN_SOURCE=600 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) @@ -61,7 +61,7 @@ ifeq ($(config),release) DEFINES += -DUT_IMPL -DNDEBUG INCLUDES += -I.. -I"$(BAKE_HOME)/include" FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) + ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC -std=c99 -D_XOPEN_SOURCE=600 ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC -std=c99 -D_XOPEN_SOURCE=600 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) diff --git a/util/build-Linux/bake_util.make b/util/build-Linux/bake_util.make index aca848df..bfade86b 100644 --- a/util/build-Linux/bake_util.make +++ b/util/build-Linux/bake_util.make @@ -18,7 +18,7 @@ ifeq ($(config),debug) DEFINES += -DUT_IMPL -DDEBUG INCLUDES += -I.. -I"$(BAKE_HOME)/include" FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) + ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c99 -D_XOPEN_SOURCE=600 ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -fPIC -g -std=c99 -D_XOPEN_SOURCE=600 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) @@ -45,7 +45,7 @@ ifeq ($(config),release) DEFINES += -DUT_IMPL -DNDEBUG INCLUDES += -I.. -I"$(BAKE_HOME)/include" FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) + ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC -std=c99 -D_XOPEN_SOURCE=600 ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2 -fPIC -std=c99 -D_XOPEN_SOURCE=600 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) diff --git a/util/build-MSYS_NT-10.0-22000/Makefile b/util/build-MSYS_NT-10.0-22000/Makefile new file mode 100644 index 00000000..c32c59f6 --- /dev/null +++ b/util/build-MSYS_NT-10.0-22000/Makefile @@ -0,0 +1,48 @@ +# Alternative GNU Make workspace makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +ifeq ($(config),debug) + bake_util_config = debug + +else ifeq ($(config),release) + bake_util_config = release + +else + $(error "invalid configuration $(config)") +endif + +PROJECTS := bake_util + +.PHONY: all clean help $(PROJECTS) + +all: $(PROJECTS) + +bake_util: +ifneq (,$(bake_util_config)) + @echo "==== Building bake_util ($(bake_util_config)) ====" + @${MAKE} --no-print-directory -C . -f bake_util.make config=$(bake_util_config) +endif + +clean: + @${MAKE} --no-print-directory -C . -f bake_util.make clean + +help: + @echo "Usage: make [config=name] [target]" + @echo "" + @echo "CONFIGURATIONS:" + @echo " debug" + @echo " release" + @echo "" + @echo "TARGETS:" + @echo " all (default)" + @echo " clean" + @echo " bake_util" + @echo "" + @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file diff --git a/util/build-MSYS_NT-10.0-22000/bake_util.make b/util/build-MSYS_NT-10.0-22000/bake_util.make new file mode 100644 index 00000000..1814ca2e --- /dev/null +++ b/util/build-MSYS_NT-10.0-22000/bake_util.make @@ -0,0 +1,266 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +TARGETDIR = .. +TARGET = $(TARGETDIR)/bake_util.dll +INCLUDES += -I.. -I"$(BAKE_HOME)/include" +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LIBS += -lshlwapi -limagehlp -ldbghelp -lws2_32 +LDDEPS += +LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +ifeq ($(config),debug) +OBJDIR = ../.bake_cache/debug +DEFINES += -DUT_IMPL -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g +ALL_LDFLAGS += $(LDFLAGS) -shared -Wl,--out-implib="../bake_util.lib" + +else ifeq ($(config),release) +OBJDIR = ../.bake_cache/release +DEFINES += -DUT_IMPL -DNDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2 +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2 +ALL_LDFLAGS += $(LDFLAGS) -shared -Wl,--out-implib="../bake_util.lib" -s + +endif + +# Per File Configurations +# ############################################# + + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/code.o +GENERATED += $(OBJDIR)/dl.o +GENERATED += $(OBJDIR)/env.o +GENERATED += $(OBJDIR)/err.o +GENERATED += $(OBJDIR)/expr.o +GENERATED += $(OBJDIR)/file.o +GENERATED += $(OBJDIR)/fs.o +GENERATED += $(OBJDIR)/fs1.o +GENERATED += $(OBJDIR)/iter.o +GENERATED += $(OBJDIR)/jsw_rbtree.o +GENERATED += $(OBJDIR)/ll.o +GENERATED += $(OBJDIR)/load.o +GENERATED += $(OBJDIR)/log.o +GENERATED += $(OBJDIR)/memory.o +GENERATED += $(OBJDIR)/os.o +GENERATED += $(OBJDIR)/parson.o +GENERATED += $(OBJDIR)/path.o +GENERATED += $(OBJDIR)/proc.o +GENERATED += $(OBJDIR)/proc_common.o +GENERATED += $(OBJDIR)/rb.o +GENERATED += $(OBJDIR)/strbuf.o +GENERATED += $(OBJDIR)/string.o +GENERATED += $(OBJDIR)/thread.o +GENERATED += $(OBJDIR)/time.o +GENERATED += $(OBJDIR)/util.o +GENERATED += $(OBJDIR)/version.o +GENERATED += $(OBJDIR)/vs.o +OBJECTS += $(OBJDIR)/code.o +OBJECTS += $(OBJDIR)/dl.o +OBJECTS += $(OBJDIR)/env.o +OBJECTS += $(OBJDIR)/err.o +OBJECTS += $(OBJDIR)/expr.o +OBJECTS += $(OBJDIR)/file.o +OBJECTS += $(OBJDIR)/fs.o +OBJECTS += $(OBJDIR)/fs1.o +OBJECTS += $(OBJDIR)/iter.o +OBJECTS += $(OBJDIR)/jsw_rbtree.o +OBJECTS += $(OBJDIR)/ll.o +OBJECTS += $(OBJDIR)/load.o +OBJECTS += $(OBJDIR)/log.o +OBJECTS += $(OBJDIR)/memory.o +OBJECTS += $(OBJDIR)/os.o +OBJECTS += $(OBJDIR)/parson.o +OBJECTS += $(OBJDIR)/path.o +OBJECTS += $(OBJDIR)/proc.o +OBJECTS += $(OBJDIR)/proc_common.o +OBJECTS += $(OBJDIR)/rb.o +OBJECTS += $(OBJDIR)/strbuf.o +OBJECTS += $(OBJDIR)/string.o +OBJECTS += $(OBJDIR)/thread.o +OBJECTS += $(OBJDIR)/time.o +OBJECTS += $(OBJDIR)/util.o +OBJECTS += $(OBJDIR)/version.o +OBJECTS += $(OBJDIR)/vs.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking bake_util + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning bake_util +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/code.o: ../src/code.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/env.o: ../src/env.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/expr.o: ../src/expr.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/file.o: ../src/file.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/fs.o: ../src/fs.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/iter.o: ../src/iter.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/jsw_rbtree.o: ../src/jsw_rbtree.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/ll.o: ../src/ll.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/load.o: ../src/load.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/log.o: ../src/log.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/memory.o: ../src/memory.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/os.o: ../src/os.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/parson.o: ../src/parson.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/path.o: ../src/path.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/proc_common.o: ../src/proc_common.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/rb.o: ../src/rb.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/strbuf.o: ../src/strbuf.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/string.o: ../src/string.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/time.o: ../src/time.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/util.o: ../src/util.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/version.o: ../src/version.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/dl.o: ../src/win/dl.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/err.o: ../src/win/err.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/fs1.o: ../src/win/fs.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/proc.o: ../src/win/proc.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/thread.o: ../src/win/thread.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/vs.o: ../src/win/vs.c + @echo "$(notdir $<)" + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file diff --git a/util/premake5.lua b/util/premake5.lua index 4143802e..c4a0c09c 100644 --- a/util/premake5.lua +++ b/util/premake5.lua @@ -3,7 +3,7 @@ workspace "bake_util" configurations { "debug", "release" } location "build" - configuration { "linux", "gmake" } + filter { "action:gmake" } buildoptions { "-std=c99", "-D_XOPEN_SOURCE=600" } project "bake_util" @@ -12,16 +12,23 @@ workspace "bake_util" location "build" targetdir "." - objdir ".bake_cache" + files { "include/*.h", "src/*.c", "include/bake-util/*.h" } - files { "include/*.h", "src/*.c", "include/posix/*.h", "src/posix/*.c" } includedirs { ".", "$(BAKE_HOME)/include" } - configuration "debug" + objdir (".bake_cache") + + filter { "action:gmake" } + files { "src/posix/*.c", "include/bake-util/posix/*.h" } + + filter { "action:gmake2" } + files { "src/win/*.c", "include/bake-util/win/*.h" } + + filter "debug" defines { "UT_IMPL", "DEBUG" } symbols "On" - configuration "release" + filter "release" defines { "UT_IMPL", "NDEBUG" } optimize "On" @@ -31,3 +38,6 @@ workspace "bake_util" filter { "system:linux", "action:gmake"} links { "rt", "dl", "pthread", "m" } + + filter { "action:gmake2" } + links { "shlwapi", "imagehlp", "dbghelp", "ws2_32" } diff --git a/util/run_premake.sh b/util/run_premake.sh index ed5557c3..f9b86776 100755 --- a/util/run_premake.sh +++ b/util/run_premake.sh @@ -1,6 +1,9 @@ rm -rf build-Darwin rm -rf build-Linux -premake5 --os=macosx gmake +rm -rf build-MSYS_NT-10.0-22000 +../../premake5 --os=macosx gmake mv build build-Darwin -premake5 --os=linux gmake +../../premake5 --os=linux gmake mv build build-Linux +../../premake5 --os=windows gmake2 +mv build build-MSYS_NT-10.0-22000