|
|
|
PREFIX = /usr/local
|
|
|
|
MANPREFIX = ${PREFIX}/share/man
|
|
|
|
CC ?= gcc
|
|
|
|
SRCDIR = ./src
|
|
|
|
CFLAGS = -Wall -Werror -pedantic -O2 -std=c11 -fno-strict-aliasing \
|
|
|
|
-I${SRCDIR} -I${PREFIX}/include/ -DLUA_USE_POSIX -D_PREFIX="${PREFIX}"
|
|
|
|
#-I/usr/include/SDL2 -I/usr/include/directfb -D_REENTRANT \
|
|
|
|
#-I/usr/include/lua5.2
|
|
|
|
# on void
|
|
|
|
LDFLAGS = -L${PREFIX}/lib -lpthread -lm -lSDL2 -llua5.2
|
|
|
|
## on alpine
|
|
|
|
#LDFLAGS = -L${PREFIX}/lib -L/usr/lib/lua5.2 -lpthread -lm -lSDL2 -llua
|
|
|
|
FILES != find ${SRCDIR} -name '*.c'
|
|
|
|
OBJS = ${FILES:.c=.o}
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
${CC} -c $< -o $@ ${CFLAGS}
|
|
|
|
|
|
|
|
lite: ${OBJS}
|
|
|
|
${CC} -o $@ ${OBJS} ${LDFLAGS}
|
|
|
|
|
|
|
|
install: lite
|
|
|
|
mkdir -p ${DESTDIR}${PREFIX}/share/lite
|
|
|
|
cp -f lite ${DESTDIR}${PREFIX}/share/lite/lite
|
|
|
|
chmod 755 ${DESTDIR}${PREFIX}/share/lite/lite
|
|
|
|
rm -rf ${DESTDIR}${PREFIX}/share/lite/data
|
|
|
|
cp -rf data/. ${DESTDIR}${PREFIX}/share/lite/data
|
|
|
|
mkdir -p ${DESTDIR}${PREFIX}/bin
|
|
|
|
ln -sf ${DESTDIR}${PREFIX}/share/lite/lite ${DESTDIR}${PREFIX}/bin/lite
|
|
|
|
# mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
|
|
|
# cp -f us.1 ${DESTDIR}${MANPREFIX}/man1/us.1
|
|
|
|
# chmod 644 ${DESTDIR}${MANPREFIX}/man1/us.1
|
|
|
|
mkdir -p ${DESTDIR}${PREFIX}/share/applications/
|
|
|
|
cp -f lite.desktop ${DESTDIR}${PREFIX}/share/applications/lite.desktop
|
|
|
|
mkdir -p ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/
|
|
|
|
cp -f icon.ico ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/lite.ico
|
|
|
|
mkdir -p ${DESTDIR}${PREFIX}/share/icons/hicolor/64x64/apps/
|
|
|
|
cp -f icon64.png ${DESTDIR}${PREFIX}/share/icons/hicolor/64x64/apps/lite.png
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f ${DESTDIR}${PREFIX}/bin/lite \
|
|
|
|
${DESTDIR}${PREFIX}/share/applications/lite.desktop \
|
|
|
|
${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/lite.ico
|
|
|
|
# ${DESTDIR}${MANPREFIX}/man1/us.1
|
|
|
|
rm -rf ${DESTDIR}${PREFIX}/share/lite
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f lite *.o ${OBJS}
|