SHELL	= /bin/sh
SRCS	= nosleep.c dict_test_helper.c
LIB_OBJ	= dict_test_helper.o
MOCK_OBJ=
TEST_OBJ=
HDRS	= dict_test_helper.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

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
nosleep.o: nosleep.c
