[ucsim] Implement [features:#769] Check writeability of output file when uart sends
[sdcc.git] / sdcc-build / lib / fetch.mk
blobaf0c9d920d52a9869eee876d5447fd81a636c640
1 # Makefile that can fetch a copy of the source trees
2 _FETCH_EXT = $(BUILDDATE)-fetched
3 _FETCH_ORIGSRCTREES = $(SRCTREES:%=$(STAMPDIR)/%.$(_FETCH_EXT))
4 _FETCH_TREE = $(shell basename $@ .$(_FETCH_EXT))
6 _FETCH_DOER = mkdir -p $(STAMPDIR); \
7 mkdir -p $(ORIGDIR); \
8 rm -f $(STAMPDIR)/$(_FETCH_TREE).*-fetched; \
9 rm -rf $(ORIGDIR)/$(_FETCH_TREE); \
10 cd $(ORIGDIR); \
11 echo "--- $(_FETCH_TREE) svn download started on `date` ---"; \
12 if test "$(ISRELEASE)" = "true"; \
13 then \
14 svn $(SVNFLAGS) export $(SVN_ROOT)/tags/$(SVNTAG)/$(_FETCH_TREE) $(_FETCH_TREE) && touch $@; \
15 else \
16 svn $(SVNFLAGS) export $(SVN_ROOT)/trunk/$(_FETCH_TREE) $(_FETCH_TREE) && touch $@; \
17 fi; \
18 echo "--- $(_FETCH_TREE) svn download finished on `date` ---"
20 # Default rule for fetching a tree from svn
21 # if SVNSERVER is defined:
22 # fetch by ssh-ing the SVNSERVER
23 # else:
24 # fetch from local machine
25 $(STAMPDIR)/%.$(_FETCH_EXT):
26 if test -z "$(SVNSERVER)"; \
27 then \
28 $(_FETCH_DOER); \
29 else \
30 ssh $(SVNSERVER) "$(_FETCH_DOER)"; \
33 fetch-orig-trees: $(_FETCH_ORIGSRCTREES)