#
# common targets
#

lib: $(OBJS)
	$(AR) uvc $(LIB) $(OBJS)
	$(MAKE) subdir TARGET=

subdir:
	if [ xx"$(DIRS)"xx != xxxx ]; then \
	  for i in $(DIRS) ..; do \
	    if [ $$i != .. ]; then \
		echo making $$i; \
		(cd $$i; $(MAKE) $(TARGET)); \
	    else true; fi; \
	  done; \
	else true; fi

libalias: $(ALIASES)
	$(AR) uvc $(LIBALIAS) $(ALIASES);

obj: $(OBJS)

asm: $(ASMS)

realclean:
	$(RM) -f .depend core *.o *.a *.s *.i tmp_make foo
	$(MAKE) subdir TARGET=realclean

clean:
	$(RM) -f core *.o *.a *.s *.i tmp_make foo
	$(MAKE) subdir TARGET=clean

depend:
	$(CC) $(CFLAGS) -M $(SRCS) > .depend
	$(MAKE) subdir TARGET=depend

#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
