Automate CFLAGS
authorteodor <teodor>
Wed, 25 Oct 2006 15:16:37 +0000 (15:16 +0000)
committerteodor <teodor>
Wed, 25 Oct 2006 15:16:37 +0000 (15:16 +0000)
Makefile

index 6fc788f..32122d4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,20 @@ RANLIB=ranlib
 LD=ld -x -shared 
 
 INCLUDE=-I.
 LD=ld -x -shared 
 
 INCLUDE=-I.
-#LINUX_CFLAGS=-D_GNU_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64
-CFLAGS=-Wall -g -O2 -pedantic -ansi -DASSERT_CORE -DHAVE_POLL_H -DHAVE_SYS_POLL_H -DHAVE_HSTRERROR $(LINUX_CFLAGS)
+CFLAGS=-Wall -g -O2 -pedantic -ansi -DASSERT_CORE -DHAVE_POLL_H -DHAVE_HSTRERROR
+
+ifndef OS
+OS=$(shell uname)
+endif
+
+ifeq ($(OS), FreeBSD)
+CFLAGS+= -DHAVE_POLL_H
+endif
+
+ifeq ($(OS), Linux)
+CFLAGS+= -DHAVE_SYS_POLL_H -D_GNU_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64
+endif
+
 LIB=-g -L. -ltedtools -lm
 
 OBJS=tlog.o tmalloc.o tools.o prs_hmap.o sfxstr.o \
 LIB=-g -L. -ltedtools -lm
 
 OBJS=tlog.o tmalloc.o tools.o prs_hmap.o sfxstr.o \