Home | History | Annotate | Download | only in clearsilver
      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 
     15 OSNAME := $(shell uname -rs | cut -f 1-2 -d "." | cut -f 1 -d "-")
     16 OSTYPE := $(shell uname -s)
     17 
     18 LIB_DIR    = $(NEOTONIC_ROOT)/libs/
     19 
     20 ## Installation Directories
     21 srcdir = @srcdir@
     22 top_srcdir = @top_srcdir@
     23 VPATH = @srcdir@
     24 prefix = @prefix@
     25 exec_prefix = @exec_prefix@
     26 
     27 bindir = @bindir@
     28 sbindir = @sbindir@
     29 libexecdir = @libexecdir@
     30 datadir = @datadir@
     31 sysconfdir = @sysconfdir@
     32 sharedstatedir = @sharedstatedir@
     33 localstatedir = @localstatedir@
     34 libdir = @libdir@
     35 infodir = @infodir@
     36 mandir = @mandir@
     37 includedir = @includedir@
     38 
     39 DESTDIR =
     40 
     41 cs_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
     47 USE_DB2 = 1
     48 
     49 USE_ZLIB = 1
     50 
     51 @USE_MINGW32@
     52 
     53 PICFLG = -fPIC
     54 ifeq ($(OSTYPE),OSF1)
     55 PICFLG =
     56 endif
     57 ifeq ($(OSNAME),MINGW32_NT)
     58 PICFLG =
     59 endif
     60 
     61 
     62 ## -------------- base (Linux/Neotonic) options
     63 
     64 PYTHON_INC = @PYTHON_INC@
     65 PYTHON_LIB = @PYTHON_LIB@
     66 PYTHON_SITE = @PYTHON_SITE@
     67 JAVA_PATH  = @JAVA_PATH@
     68 JAVA_INCLUDE_PATH = @JAVA_INCLUDE_PATH@
     69 CSHARP_PATH = @CSHARP_PATH@
     70 
     71 ## Programs
     72 @SET_MAKE@
     73 INSTALL    = @INSTALL@
     74 CC	   = @CC@
     75 MKDIR      = mkdir -p
     76 RM         = rm -f
     77 CPP        = g++
     78 JAVAC      = $(JAVA_PATH)/bin/javac
     79 JAVAH      = $(JAVA_PATH)/bin/javah
     80 JAR        = $(JAVA_PATH)/bin/jar
     81 APXS       = @APXS_PATH@
     82 PYTHON     = @PYTHON@
     83 PERL	   = @PERL@
     84 RUBY       = @RUBY@
     85 
     86 CPPFLAGS   = -I$(NEOTONIC_ROOT) @CPPFLAGS@
     87 CFLAGS     = @CFLAGS@ -Wall $(CPPFLAGS) $(PICFLG)
     88 OUTPUT_OPTION = -o $@
     89 LD         = $(CC) -o
     90 LDFLAGS    = -L$(LIB_DIR) @LDFLAGS@
     91 LDSHARED   = $(CC) -shared $(PICFLG)
     92 CPPLDSHARED   = $(CPP) -shared $(PICFLG)
     93 AR         = @AR@ cr
     94 RANLIB     = @RANLIB@
     95 DEP_LIBS   = $(DLIBS:-l%=$(LIB_DIR)lib%.a)
     96 DBI_LIBS   = -ldbi -ldl -lz
     97 LIBS       = @LIBS@
     98 LS         = /bin/ls
     99 XARGS      = xargs -i%
    100 BUILD_WRAPPERS = @BUILD_WRAPPERS@
    101 EXTRA_UTL_OBJS = @EXTRA_UTL_OBJS@
    102 EXTRA_UTL_SRC  = @EXTRA_UTL_SRC@
    103 
    104 ## I don't really feel like writing a configure thing for this yet
    105 ifeq ($(OSNAME),SunOS)
    106 LDSHARED   = ld -G -fPIC
    107 endif
    108 ifeq ($(OSTYPE),Darwin)
    109 LDSHARED   = $(CC) -bundle -flat_namespace -undefined suppress $(PICFLG)
    110 CPPLDSHARED   = $(CPP) -bundle -flat_namespace -undefined suppress $(PICFLG)
    111 endif
    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 
    147 everything: depend all
    148 
    149 .PHONY: depend
    150 depend: Makefile.depends
    151 
    152 SOURCE_FILES := $(wildcard *.c)
    153 Makefile.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 
    166 DEPEND_FILE := $(shell find . -name Makefile.depends -print)
    167 ifneq ($(DEPEND_FILE),)
    168 include Makefile.depends
    169 endif
    170