From f8f3d917eb89b27574526a7f3ddbcc92f21b662b Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sat, 20 Feb 2021 09:01:14 +0100 Subject: [PATCH] Fix installation --- .gitignore | 2 ++ Makefile | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5fd32e2a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/* +lite diff --git a/Makefile b/Makefile index 50b45a0d..f5d1efa3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PREFIX ?= /usr/local +PREFIX ?= $(HOME)/.local TARGET ?= lite OBJ_DIR ?= $(shell pwd)/build @@ -16,12 +16,12 @@ CC := gcc CFLAGS ?= LDLAGS ?= -CFLAGS +=-Wall -O3 -g -std=gnu11 -fno-strict-aliasing -Isrc -fPIC -DLUA_COMPAT_ALL -LDFLAGS +=-lSDL2 -lm +CFLAGS +=-Wall -O3 -g -std=gnu11 -fno-strict-aliasing -Isrc +LDFLAGS +=-lSDL2 -lm -ldl UNAME := $(shell uname -s) ifeq ($(UNAME_S),Linux) -CFLAGS +=-DLUA_USE_POSIX +CFLAGS +=-DLUA_USE_POSIX -fPIC -DLUA_COMPAT_ALL endif all: $(TARGET) @@ -30,7 +30,7 @@ $(TARGET): $(OBJECTS) $(CC) $^ -o $@ $(LDFLAGS) $(OBJ_DIR)/%$(OBJ_EXT): $(SRC_DIR)/%$(SRC_EXT) - mkdir -p $(dir $@) + @mkdir -p $(dir $@) $(CC) -c $(CFLAGS) $< -o $@ clean: @@ -42,4 +42,7 @@ install: all @echo Installing to $(DESTDIR)$(PREFIX) ... @mkdir -p $(DESTDIR)$(PREFIX)/bin/ @cp -fp $(TARGET) $(DESTDIR)$(PREFIX)/bin/ + @mkdir -p $(DESTDIR)$(PREFIX)/bin/data + @echo Copying lua files to $(DESTDIR)$(PREFIX)/bin/data + @cp -r data/* $(DESTDIR)$(PREFIX)/bin/data/ @echo Complete.