Merge pull request #13 from CapsCollective/use-cxxflags
Updated Makefile to use CXXFLAGS for macro passing
This commit is contained in:
commit
5a09daf7d6
5
Makefile
5
Makefile
@ -11,9 +11,6 @@ objects := $(patsubst src/%, $(buildDir)/%, $(patsubst %.cpp, %.o, $(sources)))
|
|||||||
depends := $(patsubst %.o, %.d, $(objects))
|
depends := $(patsubst %.o, %.d, $(objects))
|
||||||
compileFlags := -std=c++17 -I include
|
compileFlags := -std=c++17 -I include
|
||||||
linkFlags = -L lib/$(platform) -l raylib
|
linkFlags = -L lib/$(platform) -l raylib
|
||||||
ifdef MACRO_DEFS
|
|
||||||
macroDefines := -D $(MACRO_DEFS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Check for Windows
|
# Check for Windows
|
||||||
ifeq ($(OS), Windows_NT)
|
ifeq ($(OS), Windows_NT)
|
||||||
@ -88,7 +85,7 @@ $(target): $(objects)
|
|||||||
# Compile objects to the build directory
|
# Compile objects to the build directory
|
||||||
$(buildDir)/%.o: src/%.cpp Makefile
|
$(buildDir)/%.o: src/%.cpp Makefile
|
||||||
$(MKDIR) $(call platformpth, $(@D))
|
$(MKDIR) $(call platformpth, $(@D))
|
||||||
$(CXX) -MMD -MP -c $(compileFlags) $< -o $@ $(macroDefines)
|
$(CXX) -MMD -MP -c $(compileFlags) $< -o $@ $(CXXFLAGS)
|
||||||
|
|
||||||
# Run the executable
|
# Run the executable
|
||||||
execute:
|
execute:
|
||||||
|
12
README.md
12
README.md
@ -92,18 +92,18 @@ $ make ARGS="--somearg"
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Specifying Custom Macro Definitions
|
### 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
|
#### macOS & Linux
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ make MACRO_DEFS=MY_MACRO
|
$ make CXXFLAGS=-DMY_MACRO=1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Windows
|
#### Windows
|
||||||
|
|
||||||
```console
|
```console
|
||||||
> mingw32-make MACRO_DEFS=MY_MACRO
|
> mingw32-make CXXFLAGS=-DMY_MACRO=1
|
||||||
```
|
```
|
||||||
|
|
||||||
### Specifying a Non-Default Compiler
|
### Specifying a Non-Default Compiler
|
||||||
@ -127,9 +127,9 @@ $ make CXX=g++
|
|||||||
It's pretty simple actually:
|
It's pretty simple actually:
|
||||||
|
|
||||||
1. Fork it from [here](https://github.com/CapsCollective/raylib-cpp-starter/fork)
|
1. Fork it from [here](https://github.com/CapsCollective/raylib-cpp-starter/fork)
|
||||||
2. Create your feature branch (git checkout -b cool-new-feature)
|
2. Create your feature branch (`git checkout -b cool-new-feature`)
|
||||||
3. Commit your changes (git commit -m "Added some feature")
|
3. Commit your changes (`git commit -m "Added some feature"`)
|
||||||
4. Push to the branch (git push origin cool-new-feature)
|
4. Push to the branch (`git push origin cool-new-feature`)
|
||||||
5. Create a new pull request for it!
|
5. Create a new pull request for it!
|
||||||
|
|
||||||
### Contributors
|
### Contributors
|
||||||
|
Loading…
Reference in New Issue
Block a user