tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 Makefile
Date Tue, 02 Apr 2002 19:03:12 GMT
costin      02/04/02 11:03:12

  Modified:    jk/native2/server/apache2 Makefile
  Log:
  Fixed the makefile.
  
  Now you can use gnumake to compile mod_jk.
  
  We support 2 build methods: ant and gnumake.
  We may add .dsp if needed ( I prefer to use ant ).
  
  One thing I want to avoid is having 'special' makefiles for each
  platform.
  
  Revision  Changes    Path
  1.2       +49 -19    jakarta-tomcat-connectors/jk/native2/server/apache2/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/Makefile,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Makefile	31 Dec 2001 19:56:13 -0000	1.1
  +++ Makefile	2 Apr 2002 19:03:12 -0000	1.2
  @@ -1,37 +1,65 @@
  -# Gnu makefile is required
  +# Gnu makefile and libtool are required
   # use -D options to overrides defaults
   
  -
   #ifndef APACHE2_HOME
   APACHE2_HOME=/opt/apache2
   #endif
   
  +JK_DIR := ../..
  +BUILD_DIR = ${JK_DIR}/../build/WEB-INF/jk2/apache2
  +
  +
  +# Extract EXTRA_CFLAGS and EXTRA_CPPFLAGS - same flags used during apache2 
  +# compilation
   include ${APACHE2_HOME}/build/config_vars.mk
  -# Yes, we use the same properties as ant
  +
  +# Yes, we use the same properties file as ant
   include ../../../build.properties
   
  +LIBTOOL=${APACHE2_HOME}/build/libtool 
  +
  +# It doesn't hurt if we include all
  +INCLUDES= -I${JK_DIR}/include \
  +          -I${APACHE2_HOME}/include \
  +          -I${JAVA_HOME}/include \
  +          -I${JAVA_HOME}/include\linux \
  +          -I${JAVA_HOME}/include\hp-ux 
  +
  +JK_CFLAGS=-DCHUNK_SIZE=4096 -DUSE_APACHE_MD5 -DHAS_APR -DHAVE_JNI
  +
  +###### Based on rules.mk ##########################################
  +ALL_CFLAGS   = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS)
  +ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS)
  +ALL_LDFLAGS  = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS)
  +ALL_LIBS     = $(EXTRA_LIBS) $(NOTEST_LIBS) $(LIBS)
  +ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES)
  +
  +# Compile commands
  +COMPILE      = $(CC)  $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(ALL_INCLUDES)
  +
  +SH_COMPILE = $(LIBTOOL) --mode=compile $(COMPILE) -prefer-pic 
  +MOD_LINK = $(LIBTOOL) --mode=link $(CC) -module -shared $(LT_LDFLAGS) $(ALL_LDFLAGS) 
  +
  +#############################################################################
   
   # ---------- File list creation -------------------- 
   # Same behavior as ant - 'all files from a dir'. 
   # Excludes are not yet implemented.
  -JK_DIR := ../..
  -BUILD_DIR = ${JK_DIR}/../build/WEB-INF/jk2/apache2
   
   COMMON_C_FILES := $(wildcard ${JK_DIR}/common/*.c )
  +JNI_C_FILES := $(wildcard ${JK_DIR}/jni/*.c )
   A2_C_FILES := $(wildcard ${JK_DIR}/server/apache2/*.c )
   H_FILES := $(wildcard ${JK_DIR}/include/*.h )
   
   COMMON_LO_FILES := $(patsubst ${JK_DIR}/common/%, ${BUILD_DIR}/%, \
   			 $(patsubst %c, %lo, ${COMMON_C_FILES} ))
  +JNI_LO_FILES := $(patsubst ${JK_DIR}/jni/%, ${BUILD_DIR}/%, \
  +			 $(patsubst %c, %lo, ${JNI_C_FILES} ))
   A2_LO_FILES := $(patsubst ${JK_DIR}/server/apache2/%, ${BUILD_DIR}/%, \
   			 $(patsubst %c, %lo, ${A2_C_FILES} ))
   
   
   # ---------- Compile rules --------------------
  -JK_CFLAGS=-I${JK_DIR}/include -I${JAVA_HOME}/include  \
  -          ${EXTRA_CPPFLAGS} ${EXTRA_CFLAGS} \
  -	  -I${APACHE2_HOME}/include
  -
   
   .PHONY: all
   
  @@ -39,25 +67,27 @@
   VPATH=.:../../common
   
   .c.lo:
  -	 ${LIBTOOL} --mode=compile ${CC} ${CFLAGS} -c $< -o $>
  +	 ${SH_COMPILE} -c $< -o $>
   
   ${BUILD_DIR}/%.lo: ${JK_DIR}/common/%.c
  -	 ${LIBTOOL} --mode=compile ${CC} ${CFLAGS} ${JK_CFLAGS} -c $< -o $@
  +	 ${SH_COMPILE} -c $< -o $@
  +
  +${BUILD_DIR}/%.lo: ${JK_DIR}/jni/%.c
  +	 ${SH_COMPILE} -c $< -o $@
   
   ${BUILD_DIR}/%.lo: ${JK_DIR}/server/apache2/%.c
  -	${LIBTOOL} --mode=compile ${CC} ${CFLAGS} ${JK_CFLAGS} -c $< -o $@
  +	 ${SH_COMPILE} -c $< -o $@
   
   
   # ---------- Targets -------------------- 
   
  -all: prepare ${APACHE2_HOME}/modules/mod_jk.so
  +all: prepare ${BUILD_DIR}/mod_jk2.so ${BUILD_DIR}/jkjni.so
   
  -${APACHE2_HOME}/modules/mod_jk.so: ${BUILD_DIR}/libjk.la
  -	( cd ${BUILD_DIR} ; ${LIBTOOL} --mode=finish libjk.la  )
  -	( cd ${BUILD_DIR} ; ${LIBTOOL} --mode=install --debug cp libjk.la ${APACHE2_HOME}/modules
)
  +${BUILD_DIR}/jkjni.so: ${JNI_LO_FILES}
  +	$(MOD_LINK) -o $@ $^
   
  -${BUILD_DIR}/libjk.la: ${COMMON_LO_FILES} ${A2_LO_FILES}
  -	${LIBTOOL} --mode=link ${CC} $< -o $@
  +${BUILD_DIR}/mod_jk2.so: ${COMMON_LO_FILES} ${A2_LO_FILES}
  +	${MOD_LINK} -o $@ $^ 
   
   ${COMMON_C_FILES} ${A2_C_FILES}: ${H_FILES}
   
  @@ -65,4 +95,4 @@
   	mkdir -p ${BUILD_DIR}
   
   clean: 
  -	rm ${BUILD_DIR}/*.lo ${BUILD_DIR}/*.la ${BUILD_DIR}/*.o
  \ No newline at end of file
  +	rm -rf ${BUILD_DIR}/*.lo ${BUILD_DIR}/*.la ${BUILD_DIR}/*.o ${BUILD_DIR}/.libs ${BUILD_DIR}/*.so
  \ No newline at end of file
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message