Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
assignment_2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benedict Gaster
assignment_2023
Commits
6e056737
Commit
6e056737
authored
4 years ago
by
BG Dummy
Browse files
Options
Downloads
Patches
Plain Diff
Added a rough makefile for OSX
parent
04767278
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-1
2 additions, 1 deletion
.gitignore
Makefile
+60
-0
60 additions, 0 deletions
Makefile
README.md
+16
-0
16 additions, 0 deletions
README.md
examples/shapes.cpp
+0
-2
0 additions, 2 deletions
examples/shapes.cpp
with
78 additions
and
3 deletions
.gitignore
+
2
−
1
View file @
6e056737
...
...
@@ -2,3 +2,4 @@ a.out
html
latex
*.o
build
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Makefile
0 → 100644
+
60
−
0
View file @
6e056737
CC
=
clang++
LD
=
clang++
CPPFLAGS
=
-std
=
c++17
-I
./osx/include/
-I
./osx/include/SDL2/
-I
./include
CFLAGS
=
-I
./osx/include/
-I
./osx/include/SDL2/
-I
./include
LDFLAGS
=
-L
./osx/lib/
-lSDL2
-lSDL2_ttf
-lSDL2_image
-lfreetype
-lpng
-lwebp
-ltiff
-ljpeg
-lbz2
-lz
-framework
OpenGL
ROOTDIR
=
./
LIBDIR
=
S
(
ROOTDIR
)
/osx/lib
CP
=
cp
ECHO
=
echo
BUILD_DIR
=
build
C_SOURCES
=
src/SDL_FontCache.c
CPP_SOURCES
=
src/app.cpp src.cpp/context.cpp
OBJECTS
=
$(
addprefix
$(
BUILD_DIR
)
/,
$(
notdir
$(
CPP_SOURCES:.cpp
=
.o
)))
vpath
%.cpp
$(
sort
$(
dir
$(
CPP_SOURCES
)))
vpath
%.cpp
examples
OBJECTS
+=
$(
addprefix
$(
BUILD_DIR
)
/,
$(
notdir
$(
C_SOURCES:.c
=
.o
)))
vpath
%.c
$(
sort
$(
dir
$(
C_SOURCES
)))
$(BUILD_DIR)/%.o
:
%.cpp Makefile | $(BUILD_DIR)
$(
ECHO
)
compiling
$<
$(
CC
)
-c
$(
CPPFLAGS
)
$<
-o
$@
$(BUILD_DIR)/%.o
:
%.c Makefile | $(BUILD_DIR)
$(
ECHO
)
compiling
$<
clang
-c
$(
CFLAGS
)
$<
-o
$@
all
:
$(BUILD_DIR)/splat $(BUILD_DIR)/shapes
$(BUILD_DIR)/splat
:
$(OBJECTS) $(BUILD_DIR)/splat.o Makefile
$(
ECHO
)
linking
$<
$(
CC
)
-L
./osx/lib/
-lSDL2
-lSDL2_ttf
-lSDL2_image
-lfreetype
-lpng
-lwebp
-ltiff
-ljpeg
-lbz2
-lz
-framework
OpenGL
-o
$@
$(
OBJECTS
)
build/splat.o
#
$(
CC
)
$(
LDFLAGS
)
-o
$@
$(
OBJECTS
)
$(
BUILD_DIR
)
/splat.o
$(
ECHO
)
success
$(BUILD_DIR)/shapes
:
$(OBJECTS) $(BUILD_DIR)/shapes.o Makefile
$(
ECHO
)
linking
$<
$(
CC
)
-L
./osx/lib/
-lSDL2
-lSDL2_ttf
-lSDL2_image
-lfreetype
-lpng
-lwebp
-ltiff
-ljpeg
-lbz2
-lz
-framework
OpenGL
-o
$@
$(
OBJECTS
)
build/shapes.o
#
$(
CC
)
$(
LDFLAGS
)
-o
$@
$(
OBJECTS
)
$(
BUILD_DIR
)
/splat.o
$(
ECHO
)
success
#######################################
# clean up
#######################################
clean
:
-
rm
-fR
.dep
$(
BUILD_DIR
)
#######################################
# dependencies
#######################################
-include
$(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
.PHONY
:
clean all
\ No newline at end of file
This diff is collapsed.
Click to expand it.
README.md
+
16
−
0
View file @
6e056737
# OSX
To build the examples simple run:
```
make
```
Then you can run:
```
build/shapes
```
```
build/splat
```
clang++ -std=c++17 -L./osx/lib/ -lSDL2 -lSDL2_ttf -lSDL2_image -lfreetype -lpng -lwebp -ltiff -ljpeg -lbz2 -lz -I./osx/include/ -I./osx/include/SDL2/ -I./include ./SDL_FontCache.o src/context.cpp src/app.cpp examples/splat.cpp -framework OpenGL
We need to build font cache
...
...
This diff is collapsed.
Click to expand it.
examples/shapes.cpp
+
0
−
2
View file @
6e056737
...
...
@@ -84,8 +84,6 @@ void MyApp::draw() {
int
height
;
get_image_size
(
some_text_
,
&
width
,
&
height
);
draw_image
(
some_text_
,
uwe
::
make_rect
(
0
,
0
,
width
,
height
),
uwe
::
make_rect
(
150
,
30
,
width
,
height
)
);
}
uwe
::
Image
MyApp
::
render_text
(
std
::
string
msg
)
{
...
...
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