# Makefile for Brazil contrib

# The project name and build directory need to be specified 1st

PROJECT=sunlabs.brazil.contrib
BUILDDIR=classes

# All the common rules go here

COMMONMAKEFILE=../Makefile.common

# List of all java files for this project.  These files can be in multiple
# directories and/or packages

SRCS = 
SRCS += ApplyXslServerTemplate.java
SRCS += LDAPTemplate.java
SRCS += RunAsHandler.java
SRCS += ReXXShell.java

OTHER=
OTHER +=README
OTHER +=Makefile
OTHER +=RunAs.c
OTHER +=libsunlabs_brazil_sunlabs_RunAsHandler.so-solaris
OTHER += $(SRCS)

# Some of this stuff needs jdk 1.4; here's how to force it

JROOT=/usr/local/java/j2sdk1.4.0
JAVAH=$(JROOT)/bin/javah
LIB=sunlabs_brazil_sunlabs_RunAsHandler
include $(COMMONMAKEFILE)

# Build the RunAsHandler native library
# This is for solaris, your milage may vary

GCC=gcc
lib: lib$(LIB).so
lib$(LIB).so: RunAsHandler.h
	gcc -Wall -I$(JROOT)/include -I$(JROOT)/include/solaris -fPIC -shared \
	-o lib$(LIB).so RunAs.c

RunAsHandler.h:
	$(JAVAH) -classpath classes \
		sunlabs.brazil.sunlabs.RunAsHandler


# Additional classpaths.  List of directories or jar/zip files that we 
# depend on to build, but don't build ourselves - jacl

EXTRA_CLASSPATH=$(ADDJARS)/xalan.jar:$(ADDJARS)/xsltc.jar:$(ADDJARS)/xercesImpl.jar:$(ADDJARS)/ldap40.jar:$(ADDJARS)/NetRexxC.jar

# List of directories that contain other projects we depend on.  We can
# issue a make on those projects to ensure they are up to date.  Their class
# files will be deposited in the class hierarchy rooted at $(BUILDDIR).

DEPENDS	= ../util ../properties ../server  ../request ../handlers 

# Information needed to run the program
# LIBS: the directory for any required native code libraries
# PACKAGE: The package for the "main" test program
# MAIN: The name of the class to invoke as the main program
# ARGS: Additional argumants to pass ro the command line


LIBS =
PACKAGE =sunlabs.brazil.server
MAIN = Main
ARGS = -config config.contrib
