Compare commits
12 Commits
9ede956d6c
...
449e777902
Author | SHA1 | Date | |
---|---|---|---|
449e777902 | |||
|
feb10e3dd3 | ||
|
254969d834 | ||
|
0b445b10ba | ||
|
f8e5c9ce55 | ||
|
554392bfba | ||
|
87a7a9b673 | ||
|
6c08a8d73e | ||
|
8e46d1769e | ||
|
5a09daf7d6 | ||
|
e18255ba57 | ||
|
f735e84d8c |
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +1,6 @@
|
||||
[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,3 +1,9 @@
|
||||
# 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)
|
||||
@ -11,9 +17,6 @@ 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)
|
||||
@ -68,15 +71,15 @@ submodules:
|
||||
# Copy the relevant header files into includes
|
||||
include: submodules
|
||||
$(MKDIR) $(call platformpth, ./include)
|
||||
$(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)
|
||||
$(call COPY,depends/raylib/src,./include,raylib.h)
|
||||
$(call COPY,depends/raylib/src,./include,raymath.h)
|
||||
$(call COPY,depends/raylib-cpp/include,./include,*.hpp)
|
||||
|
||||
# Build the raylib static library file and copy it into lib
|
||||
lib: submodules
|
||||
cd vendor/raylib-cpp/vendor/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
|
||||
cd depends/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
|
||||
$(MKDIR) $(call platformpth, lib/$(platform))
|
||||
$(call COPY,vendor/raylib-cpp/vendor/raylib/$(libGenDir),lib/$(platform),libraylib.a)
|
||||
$(call COPY,depends/raylib/$(libGenDir),lib/$(platform),libraylib.a)
|
||||
|
||||
# Link the program and create the executable
|
||||
$(target): $(objects)
|
||||
@ -88,7 +91,7 @@ $(target): $(objects)
|
||||
# Compile objects to the build directory
|
||||
$(buildDir)/%.o: src/%.cpp Makefile
|
||||
$(MKDIR) $(call platformpth, $(@D))
|
||||
$(CXX) -MMD -MP -c $(compileFlags) $< -o $@ $(macroDefines)
|
||||
$(CXX) -MMD -MP -c $(compileFlags) $< -o $@ $(CXXFLAGS)
|
||||
|
||||
# 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 the `MACRO_DEFS` flag:
|
||||
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`:
|
||||
|
||||
#### macOS & Linux
|
||||
|
||||
```console
|
||||
$ make MACRO_DEFS=MY_MACRO
|
||||
$ make CXXFLAGS=-DMY_MACRO=1
|
||||
```
|
||||
|
||||
#### Windows
|
||||
|
||||
```console
|
||||
> mingw32-make MACRO_DEFS=MY_MACRO
|
||||
> mingw32-make CXXFLAGS=-DMY_MACRO=1
|
||||
```
|
||||
|
||||
### 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,6 +137,8 @@ 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
depends/raylib
Submodule
1
depends/raylib
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 0851960397f02a477d80eda2239f90fae14dec64
|
1
depends/raylib-cpp
Submodule
1
depends/raylib-cpp
Submodule
@ -0,0 +1 @@
|
||||
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-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).
|
||||
`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).
|
||||
```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-cpp/vendor/raylib/src,./include,raylib.h)
|
||||
$(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raymath.h)
|
||||
$(call COPY,vendor/raylib/src,./include,raylib.h)
|
||||
$(call COPY,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-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)
|
||||
cd vendor/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
|
||||
$(MKDIR) $(call platformpth, lib/$(platform))
|
||||
$(call COPY,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
Submodule
1
vendor/raylib
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 0851960397f02a477d80eda2239f90fae14dec64
|
2
vendor/raylib-cpp
vendored
2
vendor/raylib-cpp
vendored
@ -1 +1 @@
|
||||
Subproject commit 725379892203da857593547e93fc30044e239ab6
|
||||
Subproject commit a8f803edae6db67dafa1f84c1099f1bbc74925ef
|
Loading…
Reference in New Issue
Block a user