Add Linux support, code cleanups
[remotetop.git] / Makefile
index e531efd..89029ab 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,19 @@ AR=ar rcv
 RANLIB=ranlib
 LD=ld -x -shared
 
+ifndef OS
+OS=$(shell uname)
+endif
+
+
 INCLUDE=-I. -I../tedtools
-CFLAGS=-Wall -g -O2 -pedantic -ansi -DASSERT_CORE -D_GNU_SOURCE -DHAVE_POLL_H -DHAVE_SYS_POLL_H -DHAVE_HSTRERROR
+CFLAGS=-Wall -g -O2 -pedantic -ansi -D$(OS) 
 LIB=-L../tedtools -ltedtools
 
+ifeq ($(OS), Linux)
+CFLAGS+= -D_GNU_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64
+endif
+
 PROGS=sendtop topd rtop
 
 .SUFFIXES: .o.c