#___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__
common: $(COMMON_OBJS)

common_clean:
	$(RM) $(COMMON_OBJS)

common_depend:
	$(DEPEND) -f$(COMMON_DIR)/common_dependencies $(COMMON_DIR)/*.c

common_messages:
	@$(RM) $(MESSAGES); touch $(MESSAGES)
	@echo Creating $@
	@for i in `ls $(COMMON_DIR)/*.c`; do \
		$(CC) $(CFLAGS) -DEXTRACT_MESSAGES -E $$i | $(XGETTEXT) - ; \
	done


###############################################################################
# Variable definitions for targets to build
###############################################################################
COMMON_DIR = $(SDIR)/common

COMMON_SRC = \
            sge_groups.c \
            sge_options.c \
            sge_sharetree.c \
            sge_complex.c \
            complex_history.c \
            execution_states.c \
            job.c \
            parse_job_cull.c \
            parse_qsub.c \
            path_aliases.c \
            read_object.c \
            read_write_cal.c \
            read_write_ckpt.c \
            read_write_host.c \
            read_write_host_group.c \
            read_write_pe.c \
            read_write_queue.c \
            read_write_ume.c \
            read_write_userprj.c \
            read_write_userset.c \
            rw_configuration.c \
            sched_conf.c \
            sig_handlers.c \
            usage.c

COMMON_OBJS = $(COMMON_SRC:.c=.o)

###############################################################################
# include dependencies for object files generated by sge_depend
###############################################################################
include $(COMMON_DIR)/common_dependencies

###############################################################################
# rules to build object codes
###############################################################################
sge_groups.o   : $(COMMON_DIR)/sge_groups.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/sge_groups.c

sge_options.o:	$(COMMON_DIR)/sge_options.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/sge_options.c

sge_sharetree.o: $(COMMON_DIR)/sge_sharetree.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/sge_sharetree.c

sge_complex.o: $(COMMON_DIR)/sge_complex.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/sge_complex.c

complex_history.o:	$(COMMON_DIR)/complex_history.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/complex_history.c
   
execution_states.o: $(COMMON_DIR)/execution_states.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/execution_states.c

job.o      : $(COMMON_DIR)/job.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/job.c

parse_job_cull.o    : $(COMMON_DIR)/parse_job_cull.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/parse_job_cull.c

parse_qsub.o:	$(COMMON_DIR)/parse_qsub.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/parse_qsub.c

path_aliases.o    : $(COMMON_DIR)/path_aliases.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/path_aliases.c

read_object.o:   $(COMMON_DIR)/read_object.c
		$(CC) $(CFLAGS) $(MEMCFLAG) -c $(COMMON_DIR)/read_object.c

read_write_cal.o:	$(COMMON_DIR)/read_write_cal.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/read_write_cal.c

read_write_ckpt.o:	$(COMMON_DIR)/read_write_ckpt.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/read_write_ckpt.c

read_write_host.o   : $(COMMON_DIR)/read_write_host.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/read_write_host.c

read_write_host_group.o:	$(COMMON_DIR)/read_write_host_group.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/read_write_host_group.c

read_write_pe.o:	$(COMMON_DIR)/read_write_pe.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/read_write_pe.c

read_write_queue.o:	$(COMMON_DIR)/read_write_queue.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/read_write_queue.c

read_write_ume.o:	$(COMMON_DIR)/read_write_ume.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/read_write_ume.c

read_write_userprj.o:	$(COMMON_DIR)/read_write_userprj.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/read_write_userprj.c

read_write_userset.o:	$(COMMON_DIR)/read_write_userset.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/read_write_userset.c

rw_configuration.o:  $(COMMON_DIR)/rw_configuration.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/rw_configuration.c

sched_conf.o   : $(COMMON_DIR)/sched_conf.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/sched_conf.c

sig_handlers.o   : $(COMMON_DIR)/sig_handlers.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/sig_handlers.c

usage.o: 	$(COMMON_DIR)/usage.c
		$(CC) $(CFLAGS) -c $(COMMON_DIR)/usage.c

