SHELL	= /bin/sh
SRCS	= nosleep.c dict_test_helper.c mock_open_as.c mock_spawn_command.c \
	mock_stat.c msg_capture.c mock_dict.c
LIB_OBJ	= dict_test_helper.o mock_open_as.o mock_spawn_command.o \
	mock_stat.o msg_capture.o mock_dict.o
MOCK_OBJ=
TEST_OBJ=
HDRS	= dict_test_helper.h mock_open_as.h mock_spawn_command.h \
	mock_stat.h msg_capture.h mock_dict.h
TESTSRC	=
DEFS	= -I. -I$(INC_DIR) -D$(SYSTYPE)
CFLAGS	= $(DEBUG) $(OPT) $(DEFS)
INCL	=
LIB	= libtesting.a
LIB_SO	= nosleep.so
TESTPROG=

LIBS	= ../../lib/lib$(LIB_PREFIX)global$(LIB_SUFFIX) \
	../../lib/lib$(LIB_PREFIX)util$(LIB_SUFFIX)
LIB_DIR	= ../../lib
INC_DIR	= ../../include
MAKES	=

.c.o:;  $(CC) $(SHLIB_CFLAGS) $(CFLAGS) -c $*.c

all: $(LIB_SO) $(LIB) $(MOCK_OBJ)

$(LIB_OBJ) $(MOCK_OBJ) $(TEST_OBJ): ../../conf/makedefs.out

Makefile: Makefile.in
	cat ../../conf/makedefs.out $? >$@

test:	$(TESTPROG)

$(LIB):	$(LIB_OBJ)
	$(_AR) $(ARFL) $(LIB) $?
	$(_RANLIB) $(LIB)

$(LIB_DIR)/$(LIB): $(LIB)
	cp $(LIB) $(LIB_DIR)
	$(_RANLIB) $(LIB_DIR)/$(LIB)

nosleep.so: nosleep.c
	$(CC) $(CFLAGS) -fPIC -shared -o $@ $?

update: lib_so_update lib_update

lib_so_update: $(LIB_SO)
	for i in $(LIB_SO); do \
	    cmp -s $$i $(LIB_DIR)/$$i 2>/dev/null || cp $$i $(LIB_DIR); \
	done

lib_update: $(LIB_DIR)/$(LIB) $(HDRS) $(MOCK_OBJ)
	-for i in $(HDRS); \
	do \
	  cmp -s $$i $(INC_DIR)/$$i 2>/dev/null || cp $$i $(INC_DIR); \
	done
	(cd $(INC_DIR); chmod 644 $(HDRS))
	-for i in $(MOCK_OBJ); \
	do \
	  cmp -s $$i $(LIB_DIR)/$$i 2>/dev/null || cp $$i $(LIB_DIR); \
	done

tests:

clean:
	rm -f $(LIB_SO) *.o

tidy: clean

depend: $(MAKES)
	(sed '1,/^# do not edit/!d' Makefile.in; \
	set -e; for i in [a-z][a-z0-9]*.c; do \
	    $(CC) -E $(DEFS) $(INCL) $$i | grep -v '[<>]' | sed -n -e '/^# *1 *"\([^"]*\)".*/{' \
	    -e 's//'`echo $$i|sed 's/c$$/o/'`': \1/' \
	    -e 's/o: \.\//o: /' -e p -e '}' ; \
	done | LANG=C sort -u) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile.in
	@$(EXPORT) make -f Makefile.in Makefile 1>&2

# do not edit below this line - it is generated by 'make depend'
dict_test_helper.o: ../../include/argv.h
dict_test_helper.o: ../../include/check_arg.h
dict_test_helper.o: ../../include/dict.h
dict_test_helper.o: ../../include/msg.h
dict_test_helper.o: ../../include/myflock.h
dict_test_helper.o: ../../include/stringops.h
dict_test_helper.o: ../../include/sys_defs.h
dict_test_helper.o: ../../include/vbuf.h
dict_test_helper.o: ../../include/vstream.h
dict_test_helper.o: ../../include/vstring.h
dict_test_helper.o: dict_test_helper.c
dict_test_helper.o: dict_test_helper.h
mock_dict.o: ../../include/argv.h
mock_dict.o: ../../include/check_arg.h
mock_dict.o: ../../include/dict.h
mock_dict.o: ../../include/dict_cdb.h
mock_dict.o: ../../include/dict_inline.h
mock_dict.o: ../../include/dict_lmdb.h
mock_dict.o: ../../include/mkmap.h
mock_dict.o: ../../include/myflock.h
mock_dict.o: ../../include/mymalloc.h
mock_dict.o: ../../include/sys_defs.h
mock_dict.o: ../../include/vbuf.h
mock_dict.o: ../../include/vstream.h
mock_dict.o: ../../include/vstring.h
mock_dict.o: mock_dict.c
mock_dict.o: mock_dict.h
mock_open_as.o: ../../include/check_arg.h
mock_open_as.o: ../../include/msg.h
mock_open_as.o: ../../include/open_as.h
mock_open_as.o: ../../include/sys_defs.h
mock_open_as.o: ../../include/vbuf.h
mock_open_as.o: ../../include/vstream.h
mock_open_as.o: ../../include/vstring.h
mock_open_as.o: mock_open_as.c
mock_open_as.o: mock_open_as.h
mock_spawn_command.o: ../../include/check_arg.h
mock_spawn_command.o: ../../include/msg.h
mock_spawn_command.o: ../../include/spawn_command.h
mock_spawn_command.o: ../../include/stringops.h
mock_spawn_command.o: ../../include/sys_defs.h
mock_spawn_command.o: ../../include/vbuf.h
mock_spawn_command.o: ../../include/vstring.h
mock_spawn_command.o: mock_spawn_command.c
mock_spawn_command.o: mock_spawn_command.h
mock_stat.o: ../../include/htable.h
mock_stat.o: ../../include/msg.h
mock_stat.o: ../../include/sys_defs.h
mock_stat.o: ../../include/wrap_stat.h
mock_stat.o: mock_stat.c
mock_stat.o: mock_stat.h
msg_capture.o: ../../include/check_arg.h
msg_capture.o: ../../include/msg.h
msg_capture.o: ../../include/mymalloc.h
msg_capture.o: ../../include/sys_defs.h
msg_capture.o: ../../include/vbuf.h
msg_capture.o: ../../include/vstream.h
msg_capture.o: ../../include/vstring.h
msg_capture.o: msg_capture.c
msg_capture.o: msg_capture.h
nosleep.o: nosleep.c
