Fix installation
This commit is contained in:
parent
31f0054ee4
commit
7c7dc44ce7
|
@ -0,0 +1,2 @@
|
||||||
|
build/*
|
||||||
|
lite
|
19
Makefile
19
Makefile
|
@ -1,4 +1,4 @@
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= $(HOME)/.local
|
||||||
TARGET ?= lite
|
TARGET ?= lite
|
||||||
|
|
||||||
OBJ_DIR ?= $(shell pwd)/build
|
OBJ_DIR ?= $(shell pwd)/build
|
||||||
|
@ -16,12 +16,12 @@ CC := gcc
|
||||||
CFLAGS ?=
|
CFLAGS ?=
|
||||||
LDLAGS ?=
|
LDLAGS ?=
|
||||||
|
|
||||||
CFLAGS +=-Wall -O3 -g -std=gnu11 -fno-strict-aliasing -Isrc -fPIC -DLUA_COMPAT_ALL
|
CFLAGS +=-Wall -O3 -g -std=gnu11 -fno-strict-aliasing -Isrc
|
||||||
LDFLAGS +=-lSDL2 -lm
|
LDFLAGS +=-lSDL2 -lm -ldl
|
||||||
|
|
||||||
UNAME := $(shell uname -s)
|
UNAME := $(shell uname -s)
|
||||||
ifeq ($(UNAME_S),Linux)
|
ifeq ($(UNAME_S),Linux)
|
||||||
CFLAGS +=-DLUA_USE_POSIX
|
CFLAGS +=-DLUA_USE_POSIX -fPIC -DLUA_COMPAT_ALL
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
@ -30,7 +30,7 @@ $(TARGET): $(OBJECTS)
|
||||||
$(CC) $^ -o $@ $(LDFLAGS)
|
$(CC) $^ -o $@ $(LDFLAGS)
|
||||||
|
|
||||||
$(OBJ_DIR)/%$(OBJ_EXT): $(SRC_DIR)/%$(SRC_EXT)
|
$(OBJ_DIR)/%$(OBJ_EXT): $(SRC_DIR)/%$(SRC_EXT)
|
||||||
mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
$(CC) -c $(CFLAGS) $< -o $@
|
$(CC) -c $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -39,7 +39,10 @@ clean:
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
@echo Installing to $(DESTDIR)$(PREFIX) ...
|
@echo Installing to $(PREFIX) ...
|
||||||
@mkdir -p $(DESTDIR)$(PREFIX)/bin/
|
@mkdir -p $(PREFIX)/bin/
|
||||||
@cp -fp $(TARGET) $(DESTDIR)$(PREFIX)/bin/
|
@cp -fp $(TARGET) $(PREFIX)/bin/
|
||||||
|
@mkdir -p $(PREFIX)/bin/data
|
||||||
|
@echo Copying lua files to $(PREFIX)/bin/data
|
||||||
|
@cp -r data/* $(PREFIX)/bin/data/
|
||||||
@echo Complete.
|
@echo Complete.
|
||||||
|
|
Loading…
Reference in New Issue