diff options
author | John Ankarström <john@ankarstrom.se> | 2022-09-02 00:07:36 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-09-02 00:07:36 +0200 |
commit | a26488497cc765890dd5dff122a1f08ca6c5ca95 (patch) | |
tree | 43b54bcae1f509e4c84aadf99cc61a4d6b42dcbe /Makefile | |
parent | 2c9fa6ec14966321ab04da35d587eb99612f0cd8 (diff) | |
download | EpisodeBrowser-a26488497cc765890dd5dff122a1f08ca6c5ca95.tar.gz |
Improve build system.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 51 |
1 files changed, 27 insertions, 24 deletions
@@ -1,37 +1,40 @@ -SYSTEM ?= vs2019 -CONFIG ?= Debug MAKEFLAGS += --no-print-directory +SHELL = sh + +SYSTEM ?= vs2019 +VS_CONFIG ?= Debug +VS_TOOLSET ?= v142 +VS_PLATFORM ?= x64 -EXE = b/$(SYSTEM)/EpisodeBrowser.exe -ifneq ($(SYSTEM), mingw) -EXE = b/$(SYSTEM)/Debug/EpisodeBrowser.exe +ifeq ($(SYSTEM), mingw) +DIR = $(DIR) +OUT = $(DIR) +else ifeq ($(SYSTEM), vs2019) +DIR = b/vs2019-$(VS_TOOLSET)-$(VS_PLATFORM) +OUT = $(DIR)/$(VS_CONFIG) +else +$(error SYSTEM=$(SYSTEM) is not supported) endif all: ifeq ($(SYSTEM), mingw) - cd b/$(SYSTEM) && cmake -DCMAKE_CONFIGURATION_TYPES=$(CONFIG) -G "Unix Makefiles" ../../c - cd b/$(SYSTEM) && cmake --build . -j -else - cd b/$(SYSTEM) && cmake -DCMAKE_CONFIGURATION_TYPES=$(CONFIG) -G "Visual Studio 16 2019" ../../c - cd b/$(SYSTEM) && cmake --build . -j --config $(CONFIG) - cp x/l/libxml2.dll b/$(SYSTEM)/$(CONFIG) + mkdir -p $(DIR) + cd $(DIR) && cmake -DCMAKE_CONFIGURATION_TYPES=$(VS_CONFIG) -G "Unix Makefiles" ../../c + cd $(DIR) && cmake --build . -j +else ifeq ($(SYSTEM), vs2019) + mkdir -p $(DIR) + cd $(DIR) && cmake -DCMAKE_CONFIGURATION_TYPES=$(VS_CONFIG) \ + -G "Visual Studio 16 2019" -T "$(VS_TOOLSET)" -A "$(VS_PLATFORM)" ../../c + cd $(DIR) && cmake --build . -j --config $(VS_CONFIG) + cp x/l/$(VS_PLATFORM)/libxml2.dll $(DIR)/$(VS_CONFIG) + cp $(OUT)/libxml2.dll "C:\Users\John\Desktop\Delat" + cp $(OUT)/libxml2.dll "C:\Users\John\Desktop\XP" endif - cp $(EXE) "C:\Users\John\Desktop\Delat" + cp $(OUT)/EpisodeBrowser.exe "C:\Users\John\Desktop\Delat" + cp $(OUT)/EpisodeBrowser.exe "C:\Users\John\Desktop\XP" clean: cd b/$(SYSTEM) && cmake --build . --target clean TAGS: c/*.cpp c/*.h etags --declarations -lc++ c/*.cpp c/*.h - -.PHONY: mingw vs2019 -b: - mkdir b -b/mingw: b - mkdir b/mingw -b/vs2019: b - mkdir b/vs2019 -mingw: b/mingw - cd b/mingw && cmake -G "Unix Makefiles" ../../c -vs2019: b/vs2019 - cd b/vs2019 && cmake -G "Visual Studio 16 2019" ../../c |