1############################################################
2#
3# rules.mk  is  A U T O   G E N E R A T E D 
4#
5# you must edit:     rules.mk.in
6#
7############################################################
8
9##
10## Global Makefile Rules
11##
12## Before including this file, you must set NEOTONIC_ROOT
13##
14
15OSNAME := $(shell uname -rs | cut -f 1-2 -d "." | cut -f 1 -d "-")
16OSTYPE := $(shell uname -s)
17
18LIB_DIR    = $(NEOTONIC_ROOT)/libs/
19
20## Installation Directories
21srcdir = @srcdir@
22top_srcdir = @top_srcdir@
23VPATH = @srcdir@
24prefix = @prefix@
25exec_prefix = @exec_prefix@
26
27bindir = @bindir@
28sbindir = @sbindir@
29libexecdir = @libexecdir@
30datadir = @datadir@
31sysconfdir = @sysconfdir@
32sharedstatedir = @sharedstatedir@
33localstatedir = @localstatedir@
34libdir = @libdir@
35infodir = @infodir@
36mandir = @mandir@
37includedir = @includedir@
38
39DESTDIR =
40
41cs_includedir = ${includedir}/ClearSilver
42
43## NOTE: The wdb code in util will tickle a bug in SleepyCat 2.4.5,
44## which ships with various versions of Linux as part of glibc.  If you
45## are going to use that code, you should compile against SleepyCat
46## 2.7.7 instead
47USE_DB2 = 1
48
49USE_ZLIB = 1
50
51@USE_MINGW32@
52
53PICFLG = -fPIC
54ifeq ($(OSTYPE),OSF1)
55PICFLG =
56endif
57ifeq ($(OSNAME),MINGW32_NT)
58PICFLG =
59endif
60
61
62## -------------- base (Linux/Neotonic) options
63
64PYTHON_INC = @PYTHON_INC@
65PYTHON_LIB = @PYTHON_LIB@
66PYTHON_SITE = @PYTHON_SITE@
67JAVA_PATH  = @JAVA_PATH@
68JAVA_INCLUDE_PATH = @JAVA_INCLUDE_PATH@
69CSHARP_PATH = @CSHARP_PATH@
70
71## Programs
72@SET_MAKE@
73INSTALL    = @INSTALL@
74CC	   = @CC@
75MKDIR      = mkdir -p
76RM         = rm -f
77CPP        = g++
78JAVAC      = $(JAVA_PATH)/bin/javac
79JAVAH      = $(JAVA_PATH)/bin/javah
80JAR        = $(JAVA_PATH)/bin/jar
81APXS       = @APXS_PATH@
82PYTHON     = @PYTHON@
83PERL	   = @PERL@
84RUBY       = @RUBY@
85
86CPPFLAGS   = -I$(NEOTONIC_ROOT) @CPPFLAGS@
87CFLAGS     = @CFLAGS@ -Wall $(CPPFLAGS) $(PICFLG)
88OUTPUT_OPTION = -o $@
89LD         = $(CC) -o
90LDFLAGS    = -L$(LIB_DIR) @LDFLAGS@
91LDSHARED   = $(CC) -shared $(PICFLG)
92CPPLDSHARED   = $(CPP) -shared $(PICFLG)
93AR         = @AR@ cr
94RANLIB     = @RANLIB@
95DEP_LIBS   = $(DLIBS:-l%=$(LIB_DIR)lib%.a)
96DBI_LIBS   = -ldbi -ldl -lz
97LIBS       = @LIBS@
98LS         = /bin/ls
99XARGS      = xargs -i%
100BUILD_WRAPPERS = @BUILD_WRAPPERS@
101EXTRA_UTL_OBJS = @EXTRA_UTL_OBJS@
102EXTRA_UTL_SRC  = @EXTRA_UTL_SRC@
103
104## I don't really feel like writing a configure thing for this yet
105ifeq ($(OSNAME),SunOS)
106LDSHARED   = ld -G -fPIC
107endif
108ifeq ($(OSTYPE),Darwin)
109LDSHARED   = $(CC) -bundle -flat_namespace -undefined suppress $(PICFLG)
110CPPLDSHARED   = $(CPP) -bundle -flat_namespace -undefined suppress $(PICFLG)
111endif
112
113## --------------win32 options
114
115## ifeq ($(OSTYPE),WindowsNT)
116## CFLAGS += -D__WINDOWS_GCC__
117## USE_DB2 = 0
118## USE_ZLIB = 0
119## # SHELL=cmd.exe
120## LS = ls
121## PYTHON_INC = -Ic:/Python22/include
122## LDSHARED= dllwrap
123## endif
124## 
125## ## --------------
126## 
127## ifeq ($(OSTYPE),FreeBSD)
128## XARGS = xargs -J%
129## # This should work on freebsd... but I wouldn't worry too much about it
130## USE_DB2 = 0
131## PYTHON_INC = -I/usr/local/include/python2.2
132## endif
133## 
134## ifeq ($(USE_ZLIB),1)
135## LIBS += -lz
136## endif
137## 
138## ifeq ($(USE_DB2),1)
139## DB2_INC = -I$(HOME)/src/db-2.7.7/dist
140## DB2_LIB = -L$(HOME)/src/db-2.7.7/dist -ldb
141## CFLAGS += $(DB2_INC)
142## endif
143
144.c.o:
145	$(CC) $(CFLAGS) $(OUTPUT_OPTION) -c $<
146
147everything: depend all
148
149.PHONY: depend
150depend: Makefile.depends
151
152SOURCE_FILES := $(wildcard *.c)
153Makefile.depends: $(NEOTONIC_ROOT)/rules.mk Makefile
154	@echo "*******************************************"
155	@echo "** Building Dependencies "
156	@echo "** OSNAME: $(OSTYPE)"
157	@rm -f Makefile.depends
158	@touch Makefile.depends
159	@if test "x" != "x$(SOURCE_FILES)"; then \
160	  for II in "$(SOURCE_FILES)"; do \
161		gcc -M -MG ${CFLAGS} $$II >> Makefile.depends; \
162	  done; \
163	 fi
164	@echo "** (done) "
165
166DEPEND_FILE := $(shell find . -name Makefile.depends -print)
167ifneq ($(DEPEND_FILE),)
168include Makefile.depends
169endif
170