summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-10-07 16:11:02 -0700
committerPixel <pixel@nobis-crew.org>2011-10-07 16:11:02 -0700
commit4f7b984f9f848ba6adae2040c520a97bb5c0e354 (patch)
treee12f6fa8a2d96c1af894bcaa6833a4a3d13108d1
parent50c6ae8c0461f12bc42d2d8a0344efd7dc186f2c (diff)
Simplifying Makefile, by offloading defines to config files, and using -imacros to load them.
-rw-r--r--Makefile6
-rw-r--r--darwin-config.h4
-rw-r--r--linux-config.h4
3 files changed, 11 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index c3ef5c4..59fa941 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ LDFLAGS += -g
endif
ifeq ($(SYSTEM),Darwin)
- LIBCORO_CFLAGS = -DCORO_SJLJ
+ CONFIG_H = darwin-config.h
ARCH_FLAGS = -arch i386
LIBS = -liconv
LD = g++ -arch i386
@@ -33,7 +33,7 @@ ifeq ($(SYSTEM),Darwin)
AS = i686-apple-darwin-as -arch i386
endif
else
- LIBCORO_CFLAGS = -DCORO_ASM
+ CONFIG_H = linux-config.h
ARCH_FLAGS = -march=i686 -m32
ASFLAGS = -march=i686 --32
STRIP = strip --strip-unneeded
@@ -41,7 +41,7 @@ endif
INCLUDES = -Iincludes -Ilibcoro
-CPPFLAGS_NO_ARCH += $(INCLUDES) -DSTDC_HEADERS -fexceptions -DWORDS_LITTLEENDIAN $(HAVES) $(LIBCORO_CFLAGS) -Wno-deprecated -D_FILE_OFFSET_BITS=64
+CPPFLAGS_NO_ARCH += $(INCLUDES) -fexceptions -Wno-deprecated -imacros $(CONFIG_H)
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
LDFLAGS += $(ARCH_FLAGS) $(LIBS)
diff --git a/darwin-config.h b/darwin-config.h
new file mode 100644
index 0000000..98f087f
--- /dev/null
+++ b/darwin-config.h
@@ -0,0 +1,4 @@
+#define STDC_HEADERS 1
+#define WORDS_LITTLEENDIAN 1
+#define CORO_SJLJ 1
+#define _FILE_OFFSET_BITS 64
diff --git a/linux-config.h b/linux-config.h
new file mode 100644
index 0000000..9ac5c07
--- /dev/null
+++ b/linux-config.h
@@ -0,0 +1,4 @@
+#define STDC_HEADERS 1
+#define WORDS_LITTLEENDIAN 1
+#define CORO_ASM 1
+#define _FILE_OFFSET_BITS 64