# Transient directory for storing timestamps
TS=.ts

#####################################################
## Extra dep needed to synchronize parallel execution
#####################################################
$(TS): $(TS)/.done
$(TS)/.done:
  $(MKDIR) -p $(dir $@)
  touch $@

#  "clean" target
GARBAGE_DIRS += $(TS)
targets = foo bar tans
timestampDIR = .ts

all: $(timestampDIR) $(targets)

%: %.c
    $(CC) -o $@ $<

$(timestampDIR):
    $(MKDIR) $@

# "clean" target
GARBAGE += $(targets)
GARBAGE_DIRS += $(timestampDIR)
ifdef ENABLE_TESTS
    ifeq ($(NULL),$(filter WINNT OS2,$(OS_ARCH)))
        DIRS += test
    endif # WIN
endif # ENABLE_TESTS