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
936c2478
Commit
936c2478
authored
2 years ago
by
Benedict Gaster
Browse files
Options
Downloads
Patches
Plain Diff
Linux support
parent
a85e8e9e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile_linux
+66
-0
66 additions, 0 deletions
Makefile_linux
README.md
+39
-0
39 additions, 0 deletions
README.md
with
105 additions
and
0 deletions
Makefile_linux
0 → 100644
+
66
−
0
View file @
936c2478
CC = clang++
LD = clang++
CPPFLAGS = -std=c++17 -I./include -I/usr/include/ -I/usr/include/SDL2 -D_THREAD_SAFE
CFLAGS = -I./include -I/usr/include/ -D_THREAD_SAFE -I/usr/include/SDL2
LDFLAGS = -L/usr/lib -lSDL2 -lSDL2_ttf -lSDL2_image -lfreetype -lpng -lwebp -ltiff -ljpeg -lbz2 -lz -framework OpenGL
ROOTDIR = ./
CP = cp
ECHO = echo
BUILD_DIR = build
C_SOURCES = src/SDL_FontCache.c
CPP_SOURCES = src/app.cpp src/context.cpp
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(CPP_SOURCES:.cpp=.o)))
vpath %.cpp $(sort $(dir $(CPP_SOURCES)))
vpath %.cpp examples
vpath %.cpp assignment
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)/sprite $(BUILD_DIR)/assignment
$(BUILD_DIR)/splat: $(OBJECTS) $(BUILD_DIR)/splat.o Makefile
$(ECHO) linking $<
$(CC) -L/usr/lib -lSDL2 -lSDL2_ttf -lSDL2_image -lfreetype -lpng -ltiff -ljpeg -lbz2 -lz -o $@ $(OBJECTS) build/splat.o
$(ECHO) success
$(BUILD_DIR)/shapes: $(OBJECTS) $(BUILD_DIR)/shapes.o Makefile
$(ECHO) linking $<
$(CC) -L/usr/lib -lSDL2 -lSDL2_ttf -lSDL2_image -lfreetype -lpng -ltiff -ljpeg -lbz2 -lz -o $@ $(OBJECTS) build/shapes.o
$(ECHO) success
$(BUILD_DIR)/sprite: $(OBJECTS) $(BUILD_DIR)/sprite.o Makefile
$(ECHO) linking $<
$(CC) -L/usr/lib -lSDL2 -lSDL2_ttf -lSDL2_image -lfreetype -lpng -ltiff -ljpeg -lbz2 -lz -o $@ $(OBJECTS) build/sprite.o
$(ECHO) success
$(BUILD_DIR)/assignment: $(OBJECTS) $(BUILD_DIR)/assignment.o Makefile
$(ECHO) linking $<
$(CC) -L/usr/lib -lSDL2 -lSDL2_ttf -lSDL2_image -lfreetype -lpng -ltiff -ljpeg -lbz2 -lz -o $@ $(OBJECTS) build/assignment.o
$(ECHO) success
#######################################
# clean up
#######################################
clean:
-rm -fR $(BUILD_DIR)/assignment $(BUILD_DIR)/sprite $(BUILD_DIR)/shapes $(BUILD_DIR)/splat $(BUILD_DIR)/*.o
#######################################
# dependencies
#######################################
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
.PHONY: clean all
This diff is collapsed.
Click to expand it.
README.md
+
39
−
0
View file @
936c2478
...
@@ -127,6 +127,45 @@ To run an example or the assigment, simply run the command, e.g. **./shapes.exe*
...
@@ -127,6 +127,45 @@ To run an example or the assigment, simply run the command, e.g. **./shapes.exe*
in the same directory. (Note: it is important that you run the executables in the
in the same directory. (Note: it is important that you run the executables in the
**window_build** directory.)
**window_build** directory.)
## Linux
For Linux you need to first install the packages
> sudo apt install libsdl2-dev
> sudo apt install libsdl2-image-dev
> sudo apt install libsdl2-ttf-dev
> sudo apt install libfreetype6-dev
> sudo apt install libtiff-dev
> sudo apt install libbz2-dev
To make it slightly easier to build both the examples and the assigment itself a Makefile is provided:
- **Makefile_linux**
To build run the command:
```
bash
make -f Makefile_linux
```
in the root directory. This will build the resulting
executables in the directory **build**. **build** will
contain the example executables:
```
bash
./build/shapes
./build/splat
./build/sprite
```
and for the assigment:
```
bash
./build/assignment
```
To run an example or the assigment, simply run the executable from the root directory, e.g. **./build/shapes**.
## OS X
## OS X
> Note: ARM based Macs (M1 or M2)
> Note: ARM based Macs (M1 or M2)
...
...
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