###############################################################################
# Variable definitions for targets to build
###############################################################################
#___INFO__MARK_BEGIN__
##########################################################################
#
#  The Contents of this file are made available subject to the terms of
#  the Sun Industry Standards Source License Version 1.2
#
#  Sun Microsystems Inc., March, 2001
#
#
#  Sun Industry Standards Source License Version 1.2
#  =================================================
#  The contents of this file are subject to the Sun Industry Standards
#  Source License Version 1.2 (the "License"); You may not use this file
#  except in compliance with the License. You may obtain a copy of the
#  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
#
#  Software provided under this License is provided on an "AS IS" basis,
#  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
#  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
#  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
#  See the License for the specific provisions governing your rights and
#  obligations concerning the Software.
#
#  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
#  Copyright: 2001 by Sun Microsystems, Inc.
#
#  All Rights Reserved.
#
##########################################################################
#___INFO__MARK_END__
TACCLIB_DIR = $(SDIR)/3rdparty/tacc_pam_sge

TACCLIB = pam_sge_authorize

TACCLIB_SRC = pam_sge_authorize.c

TACCFOO_SRC = foo.c

TACCFOO_OBJS = foo.o

TACCFOO = foo

TACCLIB_OBJS = $(TACCLIB_SRC:.c=.o)

###############################################################################
# global rules: all, clean, depend, messages
###############################################################################

tacclib: tacclib_so

tacclib_so:	$(TACCLIB)$(SHAREDEXT)

clean:
		$(RM) $(TACCLIB_OBJS) $(TACCLIB)$(SHAREDEXT)

depend:
		$(DEPEND) -f$(TACCLIB_DIR)/tacc_dependencies $(TACCLIB_DIR)/*.c

messages:
	@echo Creating $@
	@for i in `ls $(TACCLIB_DIR)/*.c`; do \
	   $(CC) $(CFLAGS) -DEXTRACT_MESSAGES -E $$i | $(XGETTEXT) - ;\
	done

###############################################################################
# rules to build library
###############################################################################

$(TACCFOO): $(TACCFOO_OBJS)
	$(CC) $(CFLAGS) -o $(TACCFOO) $(TACCFOO_OBJS) libsge.a libsched.a libevc.a libgdi.a libsgeobj.a libsgeobjd.a libcull.a libcomm.a libcommlists.a libuti.a -lc -ldl  -lm -lpthread

$(TACCLIB)$(SHAREDEXT): $(TACCLIB_OBJS) $(SGEOBJDLIB) $(COMMLIB) $(COMMLISTSLIB) $(CULLLIB) $(UTILIB)
	$(SHAREDLD) $(SHARED_LFLAGS) -o $(TACCLIB)$(SHAREDEXT) $(TACCLIB_OBJS) libsge.a libcull.a libuti.a -ldl -lpthread

###############################################################################
# include dependencies for object files generated by sge_depend
###############################################################################
include $(TACCLIB_DIR)/tacc_dependencies

###############################################################################
# rules to build object codes
###############################################################################

#pam_test_subroutine.o:	$(TACCLIB_DIR)/pam_test_subroutine.c
#		$(CC) $(CFLAGS) $(SHARED_CFLAGS) -c $(TACCLIB_DIR)/pam_test_subroutine.c

# note - use -DPAM_DEBUG to debug this sucker - see comments in code
pam_sge_authorize.o:	$(TACCLIB_DIR)/pam_sge_authorize.c
		$(CC) $(CFLAGS) $(SHARED_CFLAGS) -c $(TACCLIB_DIR)/pam_sge_authorize.c

$(TACCFOO_OBJS):	$(TACCLIB_DIR)/foo.c
		$(CC) $(CFLAGS) $(SHARED_CFLAGS) -c $(TACCLIB_DIR)/foo.c


#---------------------------------------------------------------------
# test programs
