Skip to content

Commit 52ff85a

Browse files
authored
Merge pull request #49 from CapsCollective/feature/scripts-cleanup
Cleaned up scripts and introduced shallow cloning for setup dependencies
2 parents 0af85cd + 71d4be2 commit 52ff85a

24 files changed

+263
-276
lines changed

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/checkout@v2
2121

2222
- name: perform setup
23-
run: ./scripts/Setup.ps1
23+
run: ./scripts/setup.ps1
2424

2525
- name: build all targets
2626
run: mingw32-make

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ endif
1818
# Set platform vars
1919
ifeq ($(platform), windows)
2020
linkFlags += -Wl,--allow-multiple-definition -pthread -lopengl32 -lgdi32 -lwinmm -mwindows -static -static-libgcc -static-libstdc++
21-
export packageScript = $(scriptsDir)/package.bat
21+
export packageScript = powershell -executionpolicy bypass $(scriptsDir)/package.ps1 --pkg-name $1 --exe-name $2 --output-dir $3 --build-dir $4 $5
2222
else ifeq ($(platform), linux)
2323
linkFlags += -Wl,--no-as-needed -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi -no-pie
2424
formatScript = $(scriptsDir)/format.sh
25-
export packageScript = $(scriptsDir)/package.sh
2625
else ifeq ($(platform), macos)
2726
linkFlags += -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL
2827
formatScript = $(scriptsDir)/format.sh
29-
export packageScript = $(scriptsDir)/package.sh
3028
endif
3129

3230
# Set directories
@@ -93,7 +91,7 @@ package-renderapp: renderapp
9391

9492
# Check to invalidate the build if flags have changed
9593
buildFlags:
96-
$(BUILD_FLAGS_SCRIPT) $(buildFlagsFile) "$(CXXFLAGS)" "$(libDir) $(binDir)"
94+
$(call BUILD_FLAGS_SCRIPT, $(buildFlagsFile), $(CXXFLAGS), $(libDir) $(binDir))
9795

9896
# Run cleanup across project
9997
clean:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ $ sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi
8989
```
9090
```console
9191
// Windows
92-
> ./scripts/Setup.ps1
92+
> ./scripts/setup.ps1
9393
```
9494

9595
3. This should install all required dependencies. Once completed a `.env` file will be generated with all required variables. If the build is completed with no issue then you can proceed to build the project.
@@ -104,7 +104,7 @@ $ ./scripts/setup.sh --include-validation-layers
104104
```
105105
```console
106106
// Windows
107-
> ./scripts/Setup.ps1 -Include_Validation_Layers
107+
> ./scripts/setup.ps1 -Include_Validation_Layers
108108
```
109109

110110
**NOTE**: Building with this option can take some time to complete. Please be patient while the project builds the required validation layers.

engine/core/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ raylibLib := $(vendorDir)/raylib-cpp/vendor/raylib/$(libGenDir)/libraylib.a
2727
$(coreLib): $(raylibLib) $(raylibIncludeDir) $(coreObjects)
2828
$(MKDIR) $(call platformpth, $(libDir))
2929
$(RM) $(call platformpth, $(coreLib))
30-
$(call COPY,$(vendorDir)/raylib-cpp/vendor/raylib/$(libGenDir),$(libDir),libraylib.a)
31-
mv $(call platformpth,$(libDir)/libraylib.a) $(call platformpth,$(libDir)/libcore.a)
32-
ar -rs $(coreLib) $(coreObjects)
30+
$(call COMBINE_LIBS, $(vendorDir)/raylib-cpp/vendor/raylib/$(libGenDir)/libraylib.a, $(coreObjects), $(libDir), core)
3331

3432
# Add all rules from dependency files
3533
-include $(coreDepends)
@@ -43,8 +41,8 @@ $(coreBinDir)/%.o: $(coreSrcDir)/%.cpp
4341
# Copy the relevant header files into includes
4442
$(raylibIncludeDir):
4543
$(MKDIR) $(call platformpth, $(raylibIncludeDir)/raylib)
46-
$(call COPY,$(vendorDir)/raylib-cpp/vendor/raylib/src,$(raylibIncludeDir)/raylib,raylib.h)
47-
$(call COPY,$(vendorDir)/raylib-cpp/vendor/raylib/src,$(raylibIncludeDir)/raylib,raymath.h)
44+
$(call COPY,$(vendorDir)/raylib-cpp/vendor/raylib/src,$(raylibIncludeDir)/raylib,raylib.h,**)
45+
$(call COPY,$(vendorDir)/raylib-cpp/vendor/raylib/src,$(raylibIncludeDir)/raylib,raymath.h,**)
4846
$(call COPY,$(vendorDir)/raylib-cpp/include,$(raylibIncludeDir)/raylib,*.hpp)
4947

5048
# Build the raylib static library file

engine/render/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ $(renderBuildDir)/assets/shaders/%.spv: $(renderSrcDir)/assets/shaders/%
5353
# Copy Vulkan libraries to the build directory
5454
vulkan-libs:
5555
$(MKDIR) $(call platformpth, $(renderBuildDir)/lib)
56-
$(call COPY_DIR,$(vendorDir)/vulkan/lib,$(renderBuildDir)/lib)
56+
$(call COPY,$(vendorDir)/vulkan/lib,$(renderBuildDir)/lib,**)

examples/game/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ game-assets:
4444
# Package the built application and all its assets to the output directory
4545
package: all
4646
$(RM) $(call platformpth,$(outputDir)/$(exampleGameOutputName))
47-
$(packageScript) $(exampleGameOutputName) $(shell basename $(exampleGameApp)) $(outputDir) $(exampleGameBuildDir)
47+
$(call PACKAGE_SCRIPT, $(exampleGameOutputName), $(shell basename $(exampleGameApp)), $(outputDir), $(exampleGameBuildDir))

examples/render/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ $(exampleRenderBinDir)/%.o: $(exampleRenderSrcDir)/%.cpp
6363
# Copy assets (and other required build files) directory to the build directory
6464
render-assets:
6565
$(MKDIR) $(call platformpth,$(exampleRenderBuildDir))
66-
$(call COPY_DIR,$(binDir)/engine/render/build,$(exampleRenderBuildDir))
66+
$(call COPY,$(binDir)/engine/render/build,$(exampleRenderBuildDir),**)
6767
$(MKDIR) $(call platformpth,$(exampleRenderBuildDir)/assets)
68-
$(call COPY_DIR,$(exampleRenderSrcDir)/assets,$(exampleRenderBuildDir)/assets)
68+
$(call COPY,$(exampleRenderSrcDir)/assets,$(exampleRenderBuildDir)/assets,**)
6969

7070
# Package the built application and all its assets to the output directory
7171
package:
7272
$(RM) "$(outputDir)/$(exampleRenderOutputName)"
73-
$(packageScript) $(exampleRenderOutputName) $(shell basename $(exampleRenderApp)) $(outputDir) $(exampleRenderBuildDir) $(packagingFlags)
73+
$(call PACKAGE_SCRIPT, $(exampleRenderOutputName), $(shell basename $(exampleRenderApp)), $(outputDir), $(exampleRenderBuildDir), $(packagingFlags))

make/Platform.mk

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ ifeq ($(OS), Windows_NT)
1111
CXX ?= g++
1212
THEN := &&
1313
PATHSEP := \$(BLANK)
14-
MKDIR = $(scriptsDir)/mkdir.bat
14+
MKDIR = powershell -executionpolicy bypass $(scriptsDir)/mkdir.ps1
1515
RM := rm -r -f
1616
EXE_NAME := .exe
1717
VOLK_OS := WIN32_KHR
18-
COPY = $(scriptsDir)/copy.bat $1 $2 $3
19-
COPY_DIR = $(scriptsDir)/copy.bat --copy-directory $1 $2
18+
COPY = powershell -executionpolicy bypass $(scriptsDir)/copy.ps1 $1 $2 $3
2019
VALIDATION_LAYERS_INSTALL_DIR := explicit_layer.d
21-
BUILD_FLAGS_SCRIPT = $(scriptsDir)/buildFlags.bat
22-
COMBINE_LIBS = powershell $(scriptsDir)/Combine-Libs.ps1 --src_libs $1 --src_objs $2 --output_dir $3 --output_name $4
20+
BUILD_FLAGS_SCRIPT = powershell -executionpolicy bypass $(scriptsDir)/buildflags.ps1 --Target $1 --CXXFlags $2 --Dirs $3
21+
COMBINE_LIBS = powershell -executionpolicy bypass $(scriptsDir)/combinelibs.ps1 --src_libs $1 --src_objs $2 --output_dir $3 --output_name $4
22+
PACKAGE_SCRIPT = powershell -executionpolicy bypass $(scriptsDir)/package.ps1 --pkg-name $1 --exe-name $2 --output-dir $3 --build-dir $4 $5
2323
else
24-
COMBINE_LIBS = $(scriptsDir)/combine-libs.sh --src_libs $1 --src_objs $2 --output_dir $3 --output_name $4
24+
COMBINE_LIBS = $(scriptsDir)/combinelibs.sh --src_libs $1 --src_objs $2 --output_dir $3 --output_name $4
2525
# Check for MacOS/Linux
2626
UNAMEOS := $(shell uname)
2727
ifeq ($(UNAMEOS), Linux)
@@ -45,5 +45,6 @@ else
4545
COPY = cp -r $1$(PATHSEP)$3 $2
4646
COPY_DIR = $(call COPY,$1,$2,$3)
4747
VALIDATION_LAYERS_INSTALL_DIR := lib/explicit_layer.d
48-
BUILD_FLAGS_SCRIPT = $(scriptsDir)/buildFlags.sh
48+
BUILD_FLAGS_SCRIPT = $(scriptsDir)/buildflags.sh $1 "$2" "$3"
49+
PACKAGE_SCRIPT = $(scriptsDir)/package.sh $1 $2 $3 $4 $5
4950
endif

scripts/applyenv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
2+
#
33
# Copyright (c) 2022 Jonathan Moallem (@J-Mo63) & Aryeh Zinn (@Raelr)
44
#
55
# This code is released under an unmodified zlib license.

scripts/buildFlags.bat

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)