Skip to content

Commit bc9cee5

Browse files
committed
Fixed mkdir errors for Windows and changed how libs were being copied
1 parent 05e342d commit bc9cee5

File tree

15 files changed

+87
-70
lines changed

15 files changed

+87
-70
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ buildFlags:
116116

117117
# Run cleanup across project
118118
clean:
119-
$(RM) $(call platformpth, $(libDir))
120-
$(RM) $(call platformpth, $(binDir))
121-
$(RM) $(call platformpth, $(outputDir))
122-
$(RM) $(call platformpth, $(buildFlagsFile))
119+
$(RM) $(call platformpth,$(libDir))
120+
$(RM) $(call platformpth,$(binDir))
121+
$(RM) $(call platformpth,$(outputDir))
122+
$(RM) $(call platformpth,$(buildFlagsFile))
123123

124124
# Check file formatting program across all source files
125125
format-check:

engine/core/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ endif
2424

2525
# Build the static library
2626
$(coreLib): $(coreObjects)
27-
$(MKDIR) $(call platformpth, $(libDir))
27+
$(call MKDIR,$(call platformpth,$(libDir)))
2828
ar -crs $(coreLib) $(coreObjects)
2929

3030
# Add all rules from dependency files
3131
-include $(coreDepends)
3232

3333
# Compile object files to the bin directory
3434
$(coreBinDir)/%.o: $(coreSrcDir)/%.cpp
35-
$(MKDIR) $(call platformpth, $(@D))
35+
$(call MKDIR,$(call platformpth,$(@D)))
3636
$(CXX) -MMD -MP -c $(compileFlags) -I $(engineDir) $< -o $@ $(CXXFLAGS)

engine/render/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ all: $(renderLib) $(vertObjects) $(fragObjects)
3434

3535
# Build the static library
3636
$(renderLib): $(renderObjects)
37-
-$(RM) $(call platformpth, $(renderLib))
37+
-$(RM) $(call platformpth,$(renderLib))
3838
$(call COMBINE_LIBS, $(renderLibs), $(renderObjects), $(libDir), render)
3939

4040
# Add all rules from dependency files
4141
-include $(renderDepends)
4242

4343
# Compile object files to the bin directory
4444
$(renderBinDir)/%.o: $(renderSrcDir)/%.cpp
45-
$(MKDIR) $(call platformpth, $(@D))
45+
$(call MKDIR, $(call platformpth,$(@D)))
4646
$(CXX) -MMD -MP -c $(compileFlags) -I $(engineDir) $< -o $@ $(CXXFLAGS) -DVK_USE_PLATFORM_$(VOLK_OS)
4747

4848
# Compile shaders to the build directory
4949
$(renderBuildDir)/assets/shaders/%.spv: $(renderSrcDir)/assets/shaders/%
50-
$(MKDIR) $(call platformpth, $(@D))
50+
$(call MKDIR, $(call platformpth,$(@D)))
5151
$(call platformpth,$(vendorDir)/glslang/build/StandAlone/glslangValidator$(EXE_NAME)) $< -V -o $@

engine/resources/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ linkFlags += -l utils
1919

2020
# Build the static library
2121
$(resourcesLib): $(resourcesObjects)
22-
$(MKDIR) $(call platformpth, $(libDir))
22+
$(call MKDIR,$(call platformpth,$(libDir)))
2323
ar -crs $(resourcesLib) $(resourcesObjects)
2424

2525
# Add all rules from dependency files
2626
-include $(resourcesDepends)
2727

2828
# Compile object files to the bin directory
2929
$(resourcesBinDir)/%.o: $(resourcesSrcDir)/%.cpp
30-
$(MKDIR) $(call platformpth, $(@D))
30+
$(call MKDIR,$(call platformpth,$(@D)))
3131
$(CXX) -MMD -MP -c $(compileFlags) -I $(engineDir) $< -o $@ $(CXXFLAGS)

engine/utils/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ utilsDepends := $(patsubst %.o, %.d, $(call rwildcard,$(utilsBinDir)/,*.o))
1717

1818
# Build the static library
1919
$(utilsLib): $(utilsObjects)
20-
$(MKDIR) $(call platformpth, $(libDir))
20+
$(call MKDIR,$(call platformpth,$(libDir)))
2121
ar -crs $(utilsLib) $(utilsObjects)
2222

2323
# Add all rules from dependency files
2424
-include $(utilsDepends)
2525

2626
# Compile object files to the bin directory
2727
$(utilsBinDir)/%.o: $(utilsSrcDir)/%.cpp
28-
$(MKDIR) $(call platformpth, $(@D))
28+
$(call MKDIR,$(call platformpth,$(@D)))
2929
$(CXX) -MMD -MP -c $(compileFlags) $< -o $@ $(CXXFLAGS)

engine/window/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ compileFlags += -I $(vendorDir)/glfw/include
2121

2222
# Build the static library
2323
$(windowLib): $(windowObjects)
24-
-$(RM) $(call platformpth, $(windowLib))
24+
-$(RM) $(call platformpth,$(windowLib))
2525
$(call COMBINE_LIBS, $(windowLibs), $(windowObjects), $(libDir), window)
2626

2727
# Add all rules from dependency files
2828
-include $(windowDepends)
2929

3030
# Compile object files to the bin directory
3131
$(windowBinDir)/%.o: $(windowSrcDir)/%.cpp
32-
$(MKDIR) $(call platformpth, $(@D))
32+
$(call MKDIR,$(call platformpth,$(@D)))
3333
$(CXX) -MMD -MP -c $(compileFlags) -I $(engineDir) $< -o $@ $(CXXFLAGS)

examples/game/Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,37 +50,37 @@ packagingFlags = $(ENV_VARS) --excludes "$(packagingExcludes)"
5050
compileFlags += -I $(vendorDir)/glfw/include -I $(vendorDir)/glm -I $(vendorDir)/freetype/include
5151
linkFlags += -l core -l window -l render -l resources -l utils
5252

53-
.PHONY: all vulkan-libs pack-assets
53+
.PHONY: all pack-assets
5454

55-
all: $(exampleGameApp) vulkan-libs pack-assets
55+
all: $(exampleGameApp) pack-assets
5656

5757
# Link the object files and create an executable
5858
$(exampleGameApp): $(utilsLib) $(windowLib) $(renderLib) $(coreLib) $(exampleGameObjects)
59-
$(MKDIR) $(call platformpth, $(@D))
59+
$(call MKDIR,$(call platformpth,$(@D)))
6060
$(CXX) $(exampleGameObjects) -o $(exampleGameApp) $(linkFlags)
6161

6262
# Add all rules from dependency files
6363
-include $(exampleGameDepends)
6464

6565
# Compile object files to the bin directory
6666
$(exampleGameBinDir)/%.o: $(exampleGameSrcDir)/%.cpp
67-
$(MKDIR) $(call platformpth, $(@D))
67+
$(call MKDIR,$(call platformpth,$(@D)))
6868
$(CXX) -MMD -MP -c $(compileFlags) -I $(engineDir) $< -o $@ $(CXXFLAGS)
6969

7070
# Copy assets directory to the build directory and pack them
7171
pack-assets:
72-
$(MKDIR) $(call platformpth, $(exampleGameBuildDir)/assets)
72+
$(call MKDIR,$(call platformpth,$(exampleGameBuildDir)/assets))
7373
$(call COPY,$(exampleGameSrcDir)/assets,$(exampleGameBuildDir)/assets,$(RWCARDGLOB))
74-
$(MKDIR) $(call platformpth,$(exampleGameBuildDir)/assets/shaders)
74+
$(call MKDIR,$(call platformpth,$(exampleGameBuildDir)/assets/shaders))
7575
$(call COPY,$(binDir)/engine/render/build/assets/shaders,$(exampleGameBuildDir)/assets/shaders,$(RWCARDGLOB))
7676
$(packerApp) $(exampleGameBuildDir)/app.pck $(exampleGameBuildDir) $(exampleGameAssets)
77+
$(RM) "$(exampleGameBuildDir)/assets"
78+
$(call PACK_LIBS_SCRIPT,$(vendorDir)/vulkan/lib,$(exampleGameBuildDir))
79+
7780

7881
# Package the built application and all its assets to the output directory
7982
package: all
8083
$(RM) "$(outputDir)/$(exampleGameOutputName)"
81-
$(call PACKAGE_SCRIPT, $(exampleGameOutputName), $(call BASENAME, $(exampleGameApp)), $(outputDir), $(exampleGameBuildDir), $(packagingFlags))
84+
$(call PACKAGE_SCRIPT,$(exampleGameOutputName),$(call BASENAME,$(exampleGameApp)),$(outputDir),$(exampleGameBuildDir),$(packagingFlags))
8285

83-
# Copy Vulkan libraries to the build directory
84-
vulkan-libs:
85-
$(call COPY_VULKAN,$(vendorDir),$(exampleGameBuildDir))
8686

examples/render/Makefile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,36 +49,34 @@ packagingFlags = $(ENV_VARS) --excludes "$(packagingExcludes)"
4949
compileFlags += -I $(vendorDir)/glfw/include -I $(vendorDir)/glm -I $(vendorDir)/freetype/include
5050
linkFlags += -l render -l window -l resources -l utils
5151

52-
.PHONY: all vulkan-libs pack-assets
52+
.PHONY: all pack-assets
5353

54-
all: $(exampleRenderApp) vulkan-libs pack-assets
54+
all: $(exampleRenderApp) pack-assets
5555

5656
# Link the object files and create an executable
5757
$(exampleRenderApp): $(renderLib) $(exampleRenderObjects)
58-
$(MKDIR) $(call platformpth, $(@D))
58+
$(call MKDIR,$(call platformpth,$(@D)))
5959
$(CXX) $(exampleRenderObjects) -o $(exampleRenderApp) $(linkFlags)
6060

6161
# Add all rules from dependency files
6262
-include $(exampleRenderDepends)
6363

6464
# Compile object files to the bin directory
6565
$(exampleRenderBinDir)/%.o: $(exampleRenderSrcDir)/%.cpp
66-
$(MKDIR) $(call platformpth, $(@D))
66+
$(call MKDIR,$(call platformpth,$(@D)))
6767
$(CXX) -MMD -MP -c $(compileFlags) -I $(engineDir) $< -o $@ $(CXXFLAGS)
6868

6969
# Copy assets directory to the build directory and pack them
7070
pack-assets:
71-
$(MKDIR) $(call platformpth, $(exampleRenderBuildDir)/assets)
71+
$(call MKDIR,$(call platformpth,$(exampleRenderBuildDir)/assets))
7272
$(call COPY,$(exampleRenderSrcDir)/assets,$(exampleRenderBuildDir)/assets,$(RWCARDGLOB))
73-
$(MKDIR) $(call platformpth,$(exampleRenderBuildDir)/assets/shaders)
73+
$(call MKDIR,$(call platformpth,$(exampleRenderBuildDir)/assets/shaders))
7474
$(call COPY,$(binDir)/engine/render/build/assets/shaders,$(exampleRenderBuildDir)/assets/shaders,$(RWCARDGLOB))
7575
$(packerApp) $(exampleRenderBuildDir)/app.pck $(exampleRenderBuildDir) $(exampleRenderAssets)
76+
$(RM) "$(exampleRenderBuildDir)/assets"
77+
$(call PACK_LIBS_SCRIPT,$(vendorDir)/vulkan/lib,$(exampleRenderBuildDir))
7678

7779
# Package the built application and all its assets to the output directory
7880
package:
7981
$(RM) "$(outputDir)/$(exampleRenderOutputName)"
8082
$(call PACKAGE_SCRIPT, $(exampleRenderOutputName), $(call BASENAME, $(exampleRenderApp)), $(outputDir), $(exampleRenderBuildDir), $(packagingFlags))
81-
82-
# Copy Vulkan libraries to the build directory
83-
vulkan-libs:
84-
$(call COPY_VULKAN,$(vendorDir),$(exampleRenderBuildDir))

examples/tilemap/Makefile

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,36 +48,34 @@ packagingFlags = $(ENV_VARS) --excludes "$(packagingExcludes)"
4848
compileFlags += -I $(vendorDir)/glfw/include -I $(vendorDir)/glm -I $(vendorDir)/freetype/include
4949
linkFlags += -l render -l window -l resources -l utils
5050

51-
.PHONY: all vulkan-libs pack-assets
51+
.PHONY: all pack-assets
5252

53-
all: $(exampleTilemapApp) vulkan-libs pack-assets
53+
all: $(exampleTilemapApp) pack-assets
5454

5555
# Link the object files and create an executable
5656
$(exampleTilemapApp): $(renderLib) $(exampleTilemapObjects)
57-
$(MKDIR) $(call platformpth, $(@D))
57+
$(call MKDIR,$(call platformpth,$(@D)))
5858
$(CXX) $(exampleTilemapObjects) -o $(exampleTilemapApp) $(linkFlags)
5959

6060
# Add all rules from dependency files
6161
-include $(exampleTilemapDepends)
6262

6363
# Compile object files to the bin directory
6464
$(exampleTilemapBinDir)/%.o: $(exampleTilemapSrcDir)/%.cpp
65-
$(MKDIR) $(call platformpth, $(@D))
65+
$(call MKDIR,$(call platformpth,$(@D)))
6666
$(CXX) -MMD -MP -c $(compileFlags) -I $(engineDir) $< -o $@ $(CXXFLAGS)
6767

6868
# Copy assets directory to the build directory and pack them
6969
pack-assets:
70-
$(MKDIR) $(call platformpth, $(exampleTilemapBuildDir)/assets)
70+
$(call MKDIR,$(call platformpth,$(exampleTilemapBuildDir)/assets))
7171
$(call COPY,$(exampleTilemapSrcDir)/assets,$(exampleTilemapBuildDir)/assets,$(RWCARDGLOB))
72-
$(MKDIR) $(call platformpth,$(exampleTilemapBuildDir)/assets/shaders)
72+
$(call MKDIR,$(call platformpth,$(exampleTilemapBuildDir)/assets/shaders))
7373
$(call COPY,$(binDir)/engine/render/build/assets/shaders,$(exampleTilemapBuildDir)/assets/shaders,$(RWCARDGLOB))
7474
$(packerApp) $(exampleTilemapBuildDir)/app.pck $(exampleTilemapBuildDir) $(exampleTilemapAssets)
75+
$(RM) "$(exampleTilemapBuildDir)/assets"
76+
$(call PACK_LIBS_SCRIPT,$(vendorDir)/vulkan/lib,$(exampleTilemapBuildDir))
7577

7678
# Package the built application and all its assets to the output directory
7779
package:
7880
$(RM) "$(outputDir)/$(exampleTilemapOutputName)"
79-
$(call PACKAGE_SCRIPT, $(exampleTilemapOutputName), $(call BASENAME, $(exampleTilemapApp)), $(outputDir), $(exampleTilemapBuildDir), $(packagingFlags))
80-
81-
# Copy Vulkan libraries to the build directory
82-
vulkan-libs:
83-
$(call COPY_VULKAN,$(vendorDir),$(exampleTilemapBuildDir))
81+
$(call PACKAGE_SCRIPT, $(exampleTilemapOutputName), $(call BASENAME, $(exampleTilemapApp)), $(outputDir), $(exampleTilemapBuildDir), $(packagingFlags))

make/Platform.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ ifeq ($(OS), Windows_NT)
1313
THEN := &&
1414
RWCARDGLOB := "*.*"
1515
PATHSEP := \$(BLANK)
16-
MKDIR = powershell -executionpolicy bypass $(scriptsDir)/mkdir.ps1
16+
MKDIR = powershell -executionpolicy bypass $(scriptsDir)/mkdir.ps1 -Path $1
1717
RM = powershell -executionpolicy bypass $(scriptsDir)/rm.ps1
1818
EXE_NAME := .exe
1919
VOLK_OS := WIN32_KHR
2020
COPY = powershell -executionpolicy bypass $(scriptsDir)/copy.ps1 -Source $1 -Destination $2 -Filter $3
21-
COPY_VULKAN = $(call COPY,$1/vulkan/lib,$2/lib,$(RWCARDGLOB)); $(call COPY,$2/lib, $2,"vulkan-1.dll"); $(RM) $2\lib\vulkan-1.dll
2221
BASENAME = $(basename $1)
2322
VALIDATION_LAYERS_INSTALL_DIR := explicit_layer.d
2423
BUILD_FLAGS_SCRIPT = powershell -executionpolicy bypass $(scriptsDir)/buildflags.ps1 --Target $1 --CXXFlags $2 --Dirs $3
2524
BUILD_LIB = powershell -executionpolicy bypass $(scriptsDir)/combinelibs.ps1 --src_objs $1 --output_dir $2 --output_name $3
2625
COMBINE_LIBS = powershell -executionpolicy bypass $(scriptsDir)/combinelibs.ps1 --src_libs $1 --src_objs $2 --output_dir $3 --output_name $4
27-
PACKAGE_SCRIPT = powershell -executionpolicy bypass $(scriptsDir)/package.ps1 --pkg-name '$1' --exe-name $2 --output-dir $3 --build-dir $4 $5
26+
PACKAGE_SCRIPT = powershell -executionpolicy bypass $(scriptsDir)/package.ps1 --pkg-name "$1" --exe-name $2 --output-dir $3 --build-dir $4 $5
27+
PACK_LIBS_SCRIPT = powershell -executionpolicy bypass $(scriptsDir)/packagelibs.ps1 '$1' '$2'
2828
else
2929
# Check for MacOS/Linux
3030
UNAMEOS := $(shell uname)
@@ -48,12 +48,12 @@ else
4848
MKDIR = mkdir -p $1
4949
RM := rm -rf
5050
COPY = cp -r $1$(PATHSEP)$3 $2
51-
COPY_VULKAN = $(call COPY,$1/vulkan/lib,$2/lib,$(RWCARDGLOB))
5251
BASENAME = $(shell basename $1)
5352
COPY_DIR = $(call COPY,$1,$2,$3)
5453
VALIDATION_LAYERS_INSTALL_DIR := lib/explicit_layer.d
5554
BUILD_FLAGS_SCRIPT = $(scriptsDir)/buildflags.sh $1 "$2" "$3"
5655
BUILD_LIB = $(scriptsDir)/combinelibs.sh --src_objs $1 --output_dir $2 --output_name $3
5756
COMBINE_LIBS = $(scriptsDir)/combinelibs.sh --src_libs $1 --src_objs $2 --output_dir $3 --output_name $4
5857
PACKAGE_SCRIPT = $(scriptsDir)/package.sh $1 $2 $3 $4 $5
58+
PACK_LIBS_SCRIPT = cp -r "$1" "$2"
5959
endif

0 commit comments

Comments
 (0)