aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Make.config3
-rw-r--r--Make.linux1
-rw-r--r--Make.osx1
-rw-r--r--Makefile3
4 files changed, 7 insertions, 1 deletions
diff --git a/Make.config b/Make.config
index 7833518..c396d98 100644
--- a/Make.config
+++ b/Make.config
@@ -10,3 +10,6 @@ LUA_INCLUDEPATH = /usr/include
# Set this to the path of your luadoc executable if you want to regenerate the
# documentation and the luadoc script isn't in your PATH
LUADOC = luadoc
+
+OS = linux
+#OS = osx
diff --git a/Make.linux b/Make.linux
new file mode 100644
index 0000000..42d5508
--- /dev/null
+++ b/Make.linux
@@ -0,0 +1 @@
+OS_FLAGS = -fpic
diff --git a/Make.osx b/Make.osx
new file mode 100644
index 0000000..c369634
--- /dev/null
+++ b/Make.osx
@@ -0,0 +1 @@
+OS_FLAGS = -fPIC -bundle
diff --git a/Makefile b/Makefile
index ab74b97..94eb51a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
include Make.config
+include Make.$(OS)
BIN = src/signal.so
OBJ = src/signal.o \
@@ -8,7 +9,7 @@ CC = gcc
INCLUDES = -I$(LUA_INCLUDEPATH)
DEFINES =
LIBS = -l$(LUA_LIBNAME)
-COMMONFLAGS = -fpic -Werror -Wall -pedantic -O2 -g -pipe
+COMMONFLAGS = -Werror -Wall -pedantic -O2 -g -pipe $(OS_FLAGS)
CFLAGS = -c $(INCLUDES) $(DEFINES) $(COMMONFLAGS)
LDFLAGS = -shared $(LIBS) $(COMMONFLAGS)