Compare commits
No commits in common. "449e777902afb1e29b8c16e4e0482ed794c6d2b2" and "9ede956d6cae4ab35eff2b5e0f88de3015ec72e5" have entirely different histories.
449e777902
...
9ede956d6c
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,6 +1,3 @@
|
||||
[submodule "vendor/raylib-cpp"]
|
||||
path = vendor/raylib-cpp
|
||||
url = https://github.com/robloach/raylib-cpp
|
||||
[submodule "vendor/raylib"]
|
||||
path = vendor/raylib
|
||||
url = https://github.com/raysan5/raylib
|
||||
|
21
Makefile
21
Makefile
@ -1,9 +1,3 @@
|
||||
# Copyright (c) 2020 Jonathan Moallem (@J-Mo63) & Aryeh Zinn (@Raelr)
|
||||
#
|
||||
# This code is released under an unmodified zlib license.
|
||||
# For conditions of distribution and use, please see:
|
||||
# https://opensource.org/licenses/Zlib
|
||||
|
||||
# Define custom functions
|
||||
rwildcard = $(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
|
||||
platformpth = $(subst /,$(PATHSEP),$1)
|
||||
@ -17,6 +11,9 @@ objects := $(patsubst src/%, $(buildDir)/%, $(patsubst %.cpp, %.o, $(sources)))
|
||||
depends := $(patsubst %.o, %.d, $(objects))
|
||||
compileFlags := -std=c++17 -I include
|
||||
linkFlags = -L lib/$(platform) -l raylib
|
||||
ifdef MACRO_DEFS
|
||||
macroDefines := -D $(MACRO_DEFS)
|
||||
endif
|
||||
|
||||
# Check for Windows
|
||||
ifeq ($(OS), Windows_NT)
|
||||
@ -71,15 +68,15 @@ submodules:
|
||||
# Copy the relevant header files into includes
|
||||
include: submodules
|
||||
$(MKDIR) $(call platformpth, ./include)
|
||||
$(call COPY,depends/raylib/src,./include,raylib.h)
|
||||
$(call COPY,depends/raylib/src,./include,raymath.h)
|
||||
$(call COPY,depends/raylib-cpp/include,./include,*.hpp)
|
||||
$(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raylib.h)
|
||||
$(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raymath.h)
|
||||
$(call COPY,vendor/raylib-cpp/include,./include,*.hpp)
|
||||
|
||||
# Build the raylib static library file and copy it into lib
|
||||
lib: submodules
|
||||
cd depends/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
|
||||
cd vendor/raylib-cpp/vendor/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
|
||||
$(MKDIR) $(call platformpth, lib/$(platform))
|
||||
$(call COPY,depends/raylib/$(libGenDir),lib/$(platform),libraylib.a)
|
||||
$(call COPY,vendor/raylib-cpp/vendor/raylib/$(libGenDir),lib/$(platform),libraylib.a)
|
||||
|
||||
# Link the program and create the executable
|
||||
$(target): $(objects)
|
||||
@ -91,7 +88,7 @@ $(target): $(objects)
|
||||
# Compile objects to the build directory
|
||||
$(buildDir)/%.o: src/%.cpp Makefile
|
||||
$(MKDIR) $(call platformpth, $(@D))
|
||||
$(CXX) -MMD -MP -c $(compileFlags) $< -o $@ $(CXXFLAGS)
|
||||
$(CXX) -MMD -MP -c $(compileFlags) $< -o $@ $(macroDefines)
|
||||
|
||||
# Run the executable
|
||||
execute:
|
||||
|
14
README.md
14
README.md
@ -92,18 +92,18 @@ $ make ARGS="--somearg"
|
||||
```
|
||||
|
||||
### Specifying Custom Macro Definitions
|
||||
You may also want to pass in your own macro definitions for certain configurations (such as setting log levels). You can pass in your definitions using `CXXFLAGS`:
|
||||
You may also want to pass in your own macro definitions for certain configurations (such as setting log levels). You can pass in your definitions using the `MACRO_DEFS` flag:
|
||||
|
||||
#### macOS & Linux
|
||||
|
||||
```console
|
||||
$ make CXXFLAGS=-DMY_MACRO=1
|
||||
$ make MACRO_DEFS=MY_MACRO
|
||||
```
|
||||
|
||||
#### Windows
|
||||
|
||||
```console
|
||||
> mingw32-make CXXFLAGS=-DMY_MACRO=1
|
||||
> mingw32-make MACRO_DEFS=MY_MACRO
|
||||
```
|
||||
|
||||
### Specifying a Non-Default Compiler
|
||||
@ -127,9 +127,9 @@ $ make CXX=g++
|
||||
It's pretty simple actually:
|
||||
|
||||
1. Fork it from [here](https://github.com/CapsCollective/raylib-cpp-starter/fork)
|
||||
2. Create your feature branch (`git checkout -b cool-new-feature`)
|
||||
3. Commit your changes (`git commit -m "Added some feature"`)
|
||||
4. Push to the branch (`git push origin cool-new-feature`)
|
||||
2. Create your feature branch (git checkout -b cool-new-feature)
|
||||
3. Commit your changes (git commit -m "Added some feature")
|
||||
4. Push to the branch (git push origin cool-new-feature)
|
||||
5. Create a new pull request for it!
|
||||
|
||||
### Contributors
|
||||
@ -137,8 +137,6 @@ It's pretty simple actually:
|
||||
- [Raelr](https://github.com/Raelr) Aryeh Zinn - co-creator, maintainer
|
||||
- [mTvare6](https://github.com/mTvare6) mTvare6 - contributor
|
||||
- [rafaeldelboni](https://github.com/rafaeldelboni) Rafael Delboni - contributor
|
||||
- [jason-cannon](https://github.com/jason-cannon) Jason Cannon - contributor
|
||||
- [return215](https://github.com/return215) Muhammad Hidayat - contributor
|
||||
|
||||
## Licence
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
Subproject commit 0851960397f02a477d80eda2239f90fae14dec64
|
@ -1 +0,0 @@
|
||||
Subproject commit a8f803edae6db67dafa1f84c1099f1bbc74925ef
|
@ -111,7 +111,7 @@ include: submodules
|
||||
...
|
||||
```
|
||||
|
||||
`submodules` is a very simple target that will update the git submodules in the project recursively, pulling in the current raylib and raylib-cpp repositories. You can [read more about git submodules here](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
|
||||
`submodules` is a very simple target that will update the git submodules in the project recursively, pulling in the current raylib-cpp repository under the `/vendor` directory and then raylib itself under its own `/vendor` directory. The reason for this, is to make sure that the pulled versions of raylib and the bindings match in version. You can [read more about git submodules here](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
|
||||
```Makefile
|
||||
submodules:
|
||||
git submodule update --init --recursive
|
||||
@ -125,8 +125,8 @@ Next, the target proceeds to call another custom function, `COPY` (a platform ag
|
||||
```Makefile
|
||||
include: submodules
|
||||
$(MKDIR) $(call platformpth, ./include)
|
||||
$(call COPY,vendor/raylib/src,./include,raylib.h)
|
||||
$(call COPY,vendor/raylib/src,./include,raymath.h)
|
||||
$(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raylib.h)
|
||||
$(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raymath.h)
|
||||
$(call COPY,vendor/raylib-cpp/include,./include,*.hpp)
|
||||
```
|
||||
|
||||
@ -139,9 +139,9 @@ Moving on to the body of the target, we move into raylib's `/src` directory and
|
||||
To complete the target, it then copies that library file into the relevant directory for your platform under `/lib`.
|
||||
```Makefile
|
||||
lib: submodules
|
||||
cd vendor/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
|
||||
$(MKDIR) $(call platformpth, lib/$(platform))
|
||||
$(call COPY,vendor/raylib/$(libGenDir),lib/$(platform),libraylib.a)
|
||||
cd vendor/raylib-cpp/vendor/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
|
||||
$(MKDIR) $(call platformpth, lib/$(platform))
|
||||
$(call COPY,vendor/raylib-cpp/vendor/raylib/$(libGenDir),lib/$(platform),libraylib.a)
|
||||
```
|
||||
|
||||
Once all of these targets have been fulfilled, `setup` ends and your project should now contain a copy of the relevant static library for your platform in `/lib`, and all the necessary header files under `/include`.
|
||||
|
1
vendor/raylib
vendored
1
vendor/raylib
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 0851960397f02a477d80eda2239f90fae14dec64
|
2
vendor/raylib-cpp
vendored
2
vendor/raylib-cpp
vendored
@ -1 +1 @@
|
||||
Subproject commit a8f803edae6db67dafa1f84c1099f1bbc74925ef
|
||||
Subproject commit 725379892203da857593547e93fc30044e239ab6
|
Loading…
Reference in New Issue
Block a user