fix: not being abled to compile in alpine

as it is explained here[0] I put CFLAGS and LDFLAGS in the wrong order causing
a failure to link

[0]: https://stackoverflow.com/questions/58775599/what-could-be-causing-linking-errors-when-compiling-in-an-alpine-docker
master^2
Alessandro Mauri 3 years ago
parent 73924ed0a6
commit 68d436202f
  1. 3
      .gitattributes
  2. 3
      .github/FUNDING.yml
  3. 14
      makefile

3
.gitattributes vendored

@ -1,3 +0,0 @@
winlib/* linguist-vendored
src/lib/* linguist-vendored
icon.inl linguist-vendored

@ -1,3 +0,0 @@
# These are supported funding model platforms
github: rxi

@ -1,21 +1,21 @@
.POSIX:
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
#CC ?= gcc
CC ?= gcc
SRCDIR = ./src
CFLAGS = -Wall -Werror -pedantic -O3 -std=c11 -fno-strict-aliasing \
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
# remove this
LDFLAGS = -L${PREFIX}/lib -lSDL2 -lm -llua5.2
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 ${CFLAGS} $< -o $@
${CC} -c $< -o $@ ${CFLAGS}
lite: ${OBJS}
${CC} ${LDFLAGS} -o $@ ${OBJS}
${CC} -o $@ ${OBJS} ${LDFLAGS}
install: lite
mkdir -p ${DESTDIR}${PREFIX}/share/lite

Loading…
Cancel
Save