diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | Makefile | 32 |
2 files changed, 21 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fafa67f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +app/ +*.o +pong \ No newline at end of file diff --git a/Makefile b/Makefile index 153d346..8f393bf 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,29 @@ CC := gcc -CFLAGS = -Og -Wall -std=c11 -Isrc/ -LDFLAGS = -PKG_CONF := pkg-config -PKG_CONF_ARGS = --exists --modversion -PKG_CONF_LDFLAGS = `pkgconf --libs raylib` -PKG_CONF_CFLAGS = `pkgconf --cflags raylib` +CFLAGS = -Og -Wall -std=c11 -Isrc/ -Iraylib/src +LDFLAGS = -lGL -lm -lpthread -ldl -lrt -lX11 -all: check_deps build pong - +all: build_deps build pong -check_deps: - @echo "Checking for dependencies..." - @printf "Raylib | " - @$(PKG_CONF) $(PKG_CONF_ARGS) raylib +build_deps: + cd raylib/src && $(MAKE) PLATFORM=PLATFORM_DESKTOP build: src/main.c src/enemy.c src/ball.c src/title.c $(CC) $(CFLAGS) $(PKG_CONF_CFLAGS) -c $? pong: main.o enemy.o ball.o title.o - $(CC) $? -o $@ $(LDFLAGS) $(PKG_CONF_LDFLAGS) -lGL -lm -lpthread -ldl -lrt -lX11 - + $(CC) $? -o $@ raylib/src/libraylib.a $(LDFLAGS) + +install: + mkdir -p app + install -Dm755 ./pong app/pong + cp -r resources app/resources + +install_flatpak: + mkdir -p /app/Pong + install -Dm755 ./pong /app/Pong/pong + cp -r resources/ /app/Pong/resources + clean: rm -fv *.o rm -fv pong + cd raylib/src && $(MAKE) clean |