;#
;# Copyright 1998, The University of Texas at Austin ("U. T. Austin").
;# All rights reserved.
;#
;# By using this software the USER indicates that he or she has read,
;# understood and will comply with the following:
;#
;# U. T. Austin hereby grants USER permission to use, copy, modify, and
;# distribute this software and its documentation for any purpose and
;# without fee, provided that:
;#
;# 1. the above copyright notice appears in all copies of the software
;#    and its documentation, or portions thereof, and 
;# 2. a full copy of this notice is included with the software and its
;#    documentation, or portions thereof, and 
;# 3. neither the software nor its documentation, nor portions thereof,
;#    is sold for profit. Any commercial sale or license of this software,
;#    copies of the software, its associated documentation and/or
;#    modifications of either is strictly prohibited without the prior
;#    consent of U. T. Austin. 
;# 
;# Title to copyright to this software and its associated documentation
;# shall at all times remain with U. T. Austin. No right is granted to
;# use in advertising, publicity or otherwise any trademark, service
;# mark, or the name of U. T. Austin.
;# 
;# This software and any associated documentation are provided "as is,"
;# and U. T. AUSTIN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESSED OR
;# IMPLIED, INCLUDING THOSE OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
;# PURPOSE, OR THAT USE OF THE SOFTWARE, MODIFICATIONS, OR ASSOCIATED
;# DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS OR
;# OTHER INTELLECTUAL PROPERTY RIGHTS OF A THIRD PARTY. U. T. Austin, The
;# University of Texas System, its Regents, officers, and employees shall
;# not be liable under any circumstances for any direct, indirect, special,
;# incidental, or consequential damages with respect to any claim by USER
;# or any third party on account of or arising from the use, or inability
;# to use, this software or its associated documentation, even if U. T.
;# Austin has been advised of the possibility of those damages.
;# 
;# Submit commercialization requests to: Office of the Executive Vice
;# President and Provost, U. T. Austin, 201 Main Bldg., Austin, Texas,
;# 78712, ATTN: Technology Licensing Specialist.
;#
;# This Makefile builds debugging versions of password database access method
;# modules and the selected shadow database access method module,
;# and the validation test drivers & programs.
;#
;# @(#)Jmakefile	1.4 09/23/98 (cc.utexas.edu)
;#
#include "../../../Jmake.local"

Initialize(INCLUDE_PATH, -I.. -I../.. -I../../.. -I../Common)

;# 
;# Debugging is always on ../defines.h for the debug level explanation
;#
X_LOCAL_CFLAGS = -DCDEBUG=3 $(X_CCDEBUG)
COMOBJ_LIB = ../../Common/libcomobj.a	/* Need common object lib */

/*
 * Things needed from package config
 */
Initialize(SHADOW_M, $p_shadow)
>LIBS
>RM

;#
;# These must be the same as PASSWDM_SRC and SHADOWM_SRC in ../Makefile
;#
PASSWDM_SRC = \
	pwm_main.c \
	pwm_local.c \
	pwm_nis.c

SHADOWM_SRC = \
	shm_adjunct.c \
	shm_aix.c \
	shm_shadow.c \
	shm_ultrix.c \
	shm_osf1.c \
	shm_hpux.c

;#
;# Test suite driver program
;#
MAIN = pwm_test.c

++SOURCES $(SHADOWM_SRC) 

METHOD_OBJ = \
|expand f!$(PASSWDM_SRC)!
	!f:\.c=\.o \
-expand \\

OBJS	= $(METHOD_OBJ) $(SHADOW_M).o $(COMOBJ_LIB) $(LIBS)

Describe(all, Setup and build everthing)
all::	srclinks
	-@echo Run InitTestFiles.sh to setup dummy files

all::	getuser

Describe(getuser, Build user lookup test program)
SingleProgramTarget(getuser, $(MAIN) $(SHADOW_M).o, $(LIBS))

getuser: $(MAIN) $(COMOBJ_LIB) $(METHOD_OBJ) $(SHADOW_M).o
	$(CC) -o getuser -DTEST_GETUSER $(JCFLAGS) $(MAIN) $(OBJS)

;#
;# putuser - build test user passwd update program
;#
;# all:: putuser
;#
;#Describe(putuser, Build user update test program)
;#putuser: $(MAIN) $(COMOBJ_LIB) $(METHOD_OBJ) $(SHADOW_M).o
;#	$(CC) -o putuser -DTEST_PUTUSER $(JCFLAGS) $(MAIN) $(OBJS)

depend::	srclinks

Describe(srclinks, Link source modules from method directory)
srclinks:
	-@for f in $(PASSWDM_SRC) $(SHADOW_M).c; do \
		if [ ! -f $$f ]; then\
			 ln -s ../$$f $$f && echo $(LNS) ../$$f $$f;\
		fi;\
	done

;#
;# Local components to 'clobber' target
;#
local_clobber::
	$(RM) $(PASSWDM_SRC) $(SHADOW_M).c
	$(RM) TestSuiteSetup.sh getuser putuser etc_*

;#
;# Dependancies for pieces of the test suite
;#
all::	TestGetUser.sh TestSuiteSetup.sh InitTestFiles.sh

TestGetUser.sh:

InitTestFiles.sh:

ThingFromSH(TestSuiteSetup)

XdirLibMake(comobj,../../Common)

DebugMulti(debug-main)

debug-main:
	@echo Debugging in $(CURRENT) is always enabled

Coda()

/* End Jmakefile */
