Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sfml-demo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Melker Filipsson Wändahl
sfml-demo
Commits
c3e95509
Commit
c3e95509
authored
3 years ago
by
Filip Strömbäck
Browse files
Options
Downloads
Patches
Plain Diff
Improved makefiles to take dependencies into account.
parent
f9ec83ce
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
basic/Makefile
+2
-2
2 additions, 2 deletions
basic/Makefile
components/Makefile
+10
-7
10 additions, 7 deletions
components/Makefile
inheritance/Makefile
+10
-7
10 additions, 7 deletions
inheritance/Makefile
with
23 additions
and
16 deletions
.gitignore
+
1
−
0
View file @
c3e95509
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
bin/
bin/
build/
build/
*.o
*.o
*.d
*.aux
*.aux
*.fdb_latexmk
*.fdb_latexmk
...
...
This diff is collapsed.
Click to expand it.
basic/Makefile
+
2
−
2
View file @
c3e95509
CXXFLAGS
:=
-std
=
c++17
CXXFLAGS
:=
-g
-std
=
c++17
LDFLAGS
:=
-lsfml-graphics
-lsfml-window
-lsfml-system
LDFLAGS
:=
-g
-lsfml-graphics
-lsfml-window
-lsfml-system
SOURCES
:=
$(
wildcard
*
.cpp
)
SOURCES
:=
$(
wildcard
*
.cpp
)
EXECUTABLES
:=
$(
patsubst %.cpp,%,
$(
SOURCES
))
EXECUTABLES
:=
$(
patsubst %.cpp,%,
$(
SOURCES
))
...
...
This diff is collapsed.
Click to expand it.
components/Makefile
+
10
−
7
View file @
c3e95509
CXXFLAGS
:=
-std
=
c++17
-Wall
-Wextra
CXXFLAGS
:=
-g
-std
=
c++17
-Wall
-Wextra
LDFLAGS
:=
-lsfml-graphics
-lsfml-window
-lsfml-system
LDFLAGS
:=
-g
-lsfml-graphics
-lsfml-window
-lsfml-system
SOURCES
:=
$(
wildcard
*
.cpp
)
SOURCES
:=
$(
wildcard
*
.cpp
)
OBJECTS
:=
$(
patsubst %.cpp,%.o,
$(
SOURCES
))
OBJECTS
:=
$(
patsubst %.cpp,%.o,
$(
SOURCES
))
#
Note: This makefile is not entirely correct, it does not take header dependencies into account.
#
Dependencies:
# It is, however, enough to compile the project here, which is the intended use. If you wish to
DEPS
:=
$(
patsubst %.o,%.d,
$(
OBJECTS
))
# develop the code further, I suggest either mymake or writing a CMake-file.
DEPFLAGS
:=
-MMD
-MP
all
:
game
all
:
game
...
@@ -14,7 +14,7 @@ pdf: uml.pdf
...
@@ -14,7 +14,7 @@ pdf: uml.pdf
.PHONY
:
clean
.PHONY
:
clean
clean
:
clean
:
rm
-f
game
$(
OBJECTS
)
rm
-f
game
$(
OBJECTS
)
$(
DEPS
)
find
.
-name
"uml.*"
|
grep
-Ev
"(pdf|tex)
$$
"
| xargs
rm
-f
find
.
-name
"uml.*"
|
grep
-Ev
"(pdf|tex)
$$
"
| xargs
rm
-f
uml.pdf
:
uml.tex
uml.pdf
:
uml.tex
...
@@ -24,4 +24,7 @@ game: $(OBJECTS)
...
@@ -24,4 +24,7 @@ game: $(OBJECTS)
g++
$(
CXXFLAGS
)
-o
game
$(
OBJECTS
)
$(
LDFLAGS
)
g++
$(
CXXFLAGS
)
-o
game
$(
OBJECTS
)
$(
LDFLAGS
)
$(OBJECTS)
:
%.o: %.cpp
$(OBJECTS)
:
%.o: %.cpp
g++
$(
CXXFLAGS
)
-c
-o
$@
$<
g++
$(
CXXFLAGS
)
$(
DEPFLAGS
)
-c
-o
$@
$<
# Include dependencies
-include
$(DEPS)
This diff is collapsed.
Click to expand it.
inheritance/Makefile
+
10
−
7
View file @
c3e95509
CXXFLAGS
:=
-std
=
c++17
-Wall
-Wextra
CXXFLAGS
:=
-g
-std
=
c++17
-Wall
-Wextra
LDFLAGS
:=
-lsfml-graphics
-lsfml-window
-lsfml-system
LDFLAGS
:=
-g
-lsfml-graphics
-lsfml-window
-lsfml-system
SOURCES
:=
$(
wildcard
*
.cpp
)
SOURCES
:=
$(
wildcard
*
.cpp
)
OBJECTS
:=
$(
patsubst %.cpp,%.o,
$(
SOURCES
))
OBJECTS
:=
$(
patsubst %.cpp,%.o,
$(
SOURCES
))
#
Note: This makefile is not entirely correct, it does not take header dependencies into account.
#
Dependencies:
# It is, however, enough to compile the project here, which is the intended use. If you wish to
DEPS
:=
$(
patsubst %.o,%.d,
$(
OBJECTS
))
# develop the code further, I suggest either mymake or writing a CMake-file.
DEPFLAGS
:=
-MMD
-MP
all
:
game
all
:
game
...
@@ -14,7 +14,7 @@ pdf: uml.pdf
...
@@ -14,7 +14,7 @@ pdf: uml.pdf
.PHONY
:
clean
.PHONY
:
clean
clean
:
clean
:
rm
-f
game
$(
OBJECTS
)
rm
-f
game
$(
OBJECTS
)
$(
DEPS
)
find
.
-name
"uml.*"
|
grep
-Ev
"(pdf|tex)
$$
"
| xargs
rm
-f
find
.
-name
"uml.*"
|
grep
-Ev
"(pdf|tex)
$$
"
| xargs
rm
-f
uml.pdf
:
uml.tex
uml.pdf
:
uml.tex
...
@@ -24,4 +24,7 @@ game: $(OBJECTS)
...
@@ -24,4 +24,7 @@ game: $(OBJECTS)
g++
$(
CXXFLAGS
)
-o
game
$(
OBJECTS
)
$(
LDFLAGS
)
g++
$(
CXXFLAGS
)
-o
game
$(
OBJECTS
)
$(
LDFLAGS
)
$(OBJECTS)
:
%.o: %.cpp
$(OBJECTS)
:
%.o: %.cpp
g++
$(
CXXFLAGS
)
-c
-o
$@
$<
g++
$(
CXXFLAGS
)
$(
DEPFLAGS
)
-c
-o
$@
$<
# Include dependencies
-include
$(DEPS)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment