projects/aports·blob master · refs

22 lines · 700 B

1--- ./makefile.orig
2+++ ./makefile
3@@ -1,6 +1,5 @@
4-# point it to where the compiler can find the Lua header files (lua.h, etc.)
5-# LUADIR = ../lua
6-LUADIR = /usr/include/lua5.1/
7+LUAPC?=lua5.1
8+LUA_CFLAGS = $(shell pkg-config --cflags $(LUAPC))
9
10 # define your own "large" integer type; not defining a proper type
11 # will default to 'long', which may cause problems with 'size_t'
12@@ -16,8 +15,8 @@
13 -Wshadow \
14 -Wwrite-strings
15
16-CFLAGS = -D_POSIX_SOURCE $(CWARNS) $(INTTYPE) -O2 -I$(LUADIR)
17-CC = gcc
18+OPT_CFLAGS ?= -O2
19+CFLAGS = -D_POSIX_SOURCE $(CWARNS) $(INTTYPE) $(OPT_CFLAGS) $(LUA_CFLAGS)
20
21 struct.so: struct.c makefile
22 $(CC) $(CFLAGS) -shared -fpic -o struct.so struct.c