Skip to content

Commit

Permalink
Fix installation
Browse files Browse the repository at this point in the history
  • Loading branch information
deric committed Feb 20, 2021
1 parent 31f0054 commit f8f3d91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/*
lite
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PREFIX ?= /usr/local
PREFIX ?= $(HOME)/.local
TARGET ?= lite

OBJ_DIR ?= $(shell pwd)/build
Expand All @@ -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)
Expand All @@ -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:
Expand All @@ -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.

0 comments on commit f8f3d91

Please sign in to comment.