Made Makefile automatically gather compilation sources from src directory
This commit is contained in:
parent
0bf363087e
commit
2002bb961b
4
Makefile
4
Makefile
@ -7,6 +7,7 @@ ifeq ($(OS), Windows_NT)
|
|||||||
platform = Windows
|
platform = Windows
|
||||||
compiler = g++
|
compiler = g++
|
||||||
options = -pthread -lopengl32 -lgdi32 -lwinmm -mwindows
|
options = -pthread -lopengl32 -lgdi32 -lwinmm -mwindows
|
||||||
|
sources = src/main.cpp
|
||||||
THEN = &&
|
THEN = &&
|
||||||
else
|
else
|
||||||
# Check for MacOS/Linux
|
# Check for MacOS/Linux
|
||||||
@ -27,6 +28,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Set UNIX macros
|
# Set UNIX macros
|
||||||
|
sources = $(shell find src -type f -name '*.cpp')
|
||||||
THEN = ;
|
THEN = ;
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -81,7 +83,7 @@ endif
|
|||||||
|
|
||||||
# Create the build folder and compile the executable
|
# Create the build folder and compile the executable
|
||||||
compile: build
|
compile: build
|
||||||
$(CXX) -std=c++17 -I include -L lib/$(platform) src/main.cpp -o $(buildFile) -l raylib $(options)
|
$(CXX) -std=c++17 -I include -L lib/$(platform) $(sources) -o $(buildFile) -l raylib $(options)
|
||||||
|
|
||||||
# Run the executable
|
# Run the executable
|
||||||
execute:
|
execute:
|
||||||
|
Loading…
Reference in New Issue
Block a user