Skip to content

Commit

Permalink
added installion instructions for linux as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
orkhasnat authored Apr 14, 2023
1 parent 3e95d80 commit 61188cb
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Makefile for Fox's Tale game

# Set compiler options
CC=g++
CFLAGS=-c -I./include -DROLL
LDFLAGS=-L./lib -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system -mwindows -DROLL

# Define source files and object files
SOURCES=$(wildcard ./src/*.cpp)
OBJECTS=$(patsubst ./src/%.cpp, ./obj/%.o, $(SOURCES))

# Define executable name
EXECUTABLE=FoxsTale

# Define cleaning targets
CLEAN_TARGETS=clean cleanall

# Define help message
HELP_MESSAGE=\
"Available targets:\n"\
"compile - Compile the game.\n"\
"clean - Delete all object files.\n"\
"cleanall- Delete all object files and the executable.\n"\
"desktop - Create a desktop shortcut to the executable.\n"\
"help - Display this help message.\n"

# Define targets
.PHONY: all
all: compile

.PHONY: compile
compile: $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $^ -o $@
mv $(EXECUTABLE) ./bin/

./obj/%.o: ./src/%.cpp
$(CC) $(CFLAGS) $< -o $@

.PHONY: clean
clean:
rm -f ./obj/*.o

.PHONY: cleanall
cleanall: clean
rm -f ./bin/$(EXECUTABLE)

.PHONY: desktop
desktop:
@echo "[Desktop Entry]" > FoxsTale.desktop
@echo "Type=Application" >> FoxsTale.desktop
@echo "Name=Fox's Tale" >> FoxsTale.desktop
@echo "Icon=$(PWD)/icon.png" >> FoxsTale.desktop
@echo "Exec=$(PWD)/bin/$(EXECUTABLE)" >> FoxsTale.desktop
@echo "Categories=Game" >> FoxsTale.desktop
@chmod +x FoxsTale.desktop
@mv FoxsTale.desktop ~/Desktop/

.PHONY: help
help:
@echo $(HELP_MESSAGE)

0 comments on commit 61188cb

Please sign in to comment.