-# $Id: GNUmakefile,v 1.5 2014/06/25 15:25:36 mmondor Exp $
+# $Id: GNUmakefile,v 1.6 2014/06/29 23:58:38 mmondor Exp $
CC := cc
RM := rm
UNAME := uname
DATE := date
-STRIP := strip
+STRIP := strip -s -w -R .comment -R .ident -R .debug*
TMPDIR := /tmp
LDFLAGS += -lm
# OS dependent settings follow
+OS_TARGET := UNIX
OS := $(shell $(UNAME) -s)
+
ifneq (,$(findstring CYGWIN,$(OS)))
# cygwin-mingw
+ OS_TARGET := MINGW
CFLAGS += -mno-cygwin -I/usr/include/mingw -DWIN32
LDFLAGS += -mwindows -mno-cygwin -L/usr/lib/mingw -L/usr/local/lib
# GL_CFLAGS :=
# GL_LDFLAGS := -lopengl32 -lglu32
-else
- # unix
+endif
+
+ifneq (,$(findstring Darwin,$(OS)))
+ # Mac OSX
+ OS_TARGET := OSX
+ CFLAGS += -I/usr/include -I/usr/local/include
+ LDFLAGS += -L/usr/lib -L/usr/local/lib
+ STRIP := strip
+# GL_CFLAGS :=
+# GL_LDFLAGS := -lGL -lGLU
+endif
+
+ifneq (,$(findstring UNIX,$(OS_TARGET)))
+ # Other unix (BSD, Linux)
CFLAGS += -I/usr/include -I/usr/pkg/include -I/usr/X11R7/include
LDFLAGS += -L/usr/lib -L/usr/pkg/lib -L/usr/X11R7/lib
# GL_CFLAGS :=
# GL_LDFLAGS := -lGL -lGLU
endif
+
SEED := $(shell $(DATE) +%s)
# Architecture independent settings follow
$(BIN): $(OBJS) $(RAWFILES_O)
$(CC) -o $@ $(OBJS) $(RAWFILES_O) $(LDFLAGS)
- $(STRIP) -s -w -R .comment -R .ident -R .debug* $@*
+ $(STRIP) $@*
clean:
$(RM) -f $(BIN) $(BIN).exe $(OBJS) \