#
# Makefile for slurmd

AUTOMAKE_OPTIONS = foreign

sbin_PROGRAMS = slurmstepd

AM_CPPFLAGS = -I$(top_srcdir) $(SSH2_CPPFLAGS)

depend_libs = 				   \
	$(top_builddir)/src/common/libdaemonize.la \
	../common/libslurmd_common.o

slurmstepd_LDADD = $(depend_libs) $(LIB_SLURM) \
	$(HWLOC_LDFLAGS) $(HWLOC_LIBS) \
	$(DL_LIBS) $(PAM_LIBS) $(UTIL_LIBS) $(SSH2_LIBS)

slurmstepd_SOURCES = 	        	\
	slurmstepd.c slurmstepd.h	\
	mgr.c mgr.h			\
	task.c task.h			\
	slurmstepd_job.c slurmstepd_job.h \
	io.c io.h			\
	ulimits.c ulimits.h     	\
	pdebug.c pdebug.h		\
	pam_ses.c pam_ses.h		\
	req.c req.h			\
	multi_prog.c multi_prog.h	\
	step_terminate_monitor.c step_terminate_monitor.h

if WITH_SLURM_X11
slurmstepd_SOURCES += x11_forwarding.c x11_forwarding.h
else
EXTRA_slurmstepd_SOURCES = x11_forwarding.c x11_forwarding.h
endif

slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(SSH2_LDFLAGS)

slurmstepd_DEPENDENCIES = $(depend_libs) $(LIB_SLURM_BUILD)

force:
$(slurmstepd_DEPENDENCIES) : force
	@cd `dirname $@` && $(MAKE) `basename $@`
