From c08fbb084067921f3af7a6fd930807e8abecfc34 Mon Sep 17 00:00:00 2001 From: alema Date: Wed, 7 Jul 2021 19:47:20 +0200 Subject: [PATCH] compile on openbsd --- makefile | 15 +++++++++------ src/api/api.h | 6 ++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index a9d64c1..9ea09e4 100644 --- a/makefile +++ b/makefile @@ -2,17 +2,20 @@ PREFIX = /usr/local MANPREFIX = ${PREFIX}/share/man -CC ?= gcc +#CC ?= gcc SRCDIR = ./src CFLAGS = -Wall -Werror -pedantic -O3 -std=c11 -fno-strict-aliasing \ - -I${SRCDIR} -DLUA_USE_POSIX + -I${SRCDIR} -I${PREFIX}/include/ -DLUA_USE_POSIX # remove this -LDFLAGS = -lSDL2 -lm -llua5.2 +LDFLAGS = -L${PREFIX}/lib -lSDL2 -lm -llua5.2 FILES != find ${SRCDIR} -name '*.c' -OBJS = $(FILES:.c=.o) +OBJS = ${FILES:.c=.o} + +.c.o: + ${CC} -c ${CFLAGS} $< -o $@ lite: ${OBJS} - ${CC} ${LDFLAGS} $^ -o $@ + ${CC} ${LDFLAGS} -o $@ ${OBJS} install: lite mkdir -p ${DESTDIR}${PREFIX}/share/lite @@ -36,4 +39,4 @@ uninstall: rm -rf ${DESTDIR}${PREFIX}/share/lite clean: - rm -f lite ${OBJS} + rm -f lite *.o ${OBJS} diff --git a/src/api/api.h b/src/api/api.h index aed3899..b0622a4 100644 --- a/src/api/api.h +++ b/src/api/api.h @@ -1,9 +1,15 @@ #ifndef API_H #define API_H +#ifdef __OpenBSD__ +#include +#include +#include +#else #include #include #include +#endif #define API_TYPE_FONT "Font"