kleine Makefile-Verbesserungen fuer nicht-svn-Nutzer
Formatierungskram
This commit is contained in:
parent
c0f43c5cf8
commit
ba8cd27e60
2 changed files with 41 additions and 44 deletions
27
Makefile
27
Makefile
|
@ -1,7 +1,7 @@
|
|||
########## Variablendefinitionen ###########
|
||||
|
||||
# Revisions-Variablen
|
||||
REVISIONS_NR := $(shell svn -R info| grep ^Revision| cut -f2 -d " " | sort | tail -1)
|
||||
REVISIONS_NR := $(shell if test -d .svn; then svn -R info | grep ^Revision | cut -f2 -d " " | sort | tail -1; else date +%Y%m%d; fi)
|
||||
REVISIONS_SUFFIX = _r$(REVISIONS_NR)
|
||||
|
||||
# Verzeichnisse
|
||||
|
@ -78,9 +78,9 @@ validate: doku kopiere_programme
|
|||
# pruefe, ob alle notwendigen/empfohlenen Verzeichnisse existieren
|
||||
verzeichnisstruktur: $(CREATE_DIRS)
|
||||
$(CREATE_DIRS):
|
||||
@if [ ! -e "$@" ] ; \
|
||||
then echo -e "directory ($@) does not exist - I will create it" ; \
|
||||
mkdir -p "$@" ; \
|
||||
@if [ ! -e "$@" ] ;\
|
||||
then echo -e "directory ($@) does not exist - I will create it" ;\
|
||||
mkdir -p "$@" ;\
|
||||
fi
|
||||
|
||||
######## die Werkzeuge #########
|
||||
|
@ -88,8 +88,11 @@ $(CREATE_DIRS):
|
|||
cd-template: verzeichnisstruktur
|
||||
@rm -rf $(CCD_BUILD_DIR)
|
||||
@# export local svn directory OR just copy the directories (for non-svn users)
|
||||
@svn export cd-template "$(CCD_BUILD_DIR)" \
|
||||
|| mkdir -p $(dir $(CCD_BUILD_DIR)) && cp -r cd-template $(CCD_BUILD_DIR)
|
||||
@if test -d .svn ;\
|
||||
then svn export cd-template "$(CCD_BUILD_DIR)" ;\
|
||||
else mkdir -p $(dir $(CCD_BUILD_DIR)) ;\
|
||||
cp -r cd-template $(CCD_BUILD_DIR) ;\
|
||||
fi
|
||||
|
||||
|
||||
doku: cd-template
|
||||
|
@ -117,9 +120,15 @@ website: doku kopiere_programme
|
|||
|
||||
source: EXPORT_FILE_SUFFIX := _src
|
||||
source:
|
||||
@echo "Exportiere die gewaehlte svn-Revision ($(REVISIONS_NR)) ..." ;\
|
||||
rm -rf "$(CCD_BUILD_DIR)" ;\
|
||||
svn export . "$(CCD_BUILD_DIR)" | $(EINRUECKEN)
|
||||
rm -rf "$(CCD_BUILD_DIR)"
|
||||
if test -d .svn ;\
|
||||
then mkdir -p "$(dir $(CCD_BUILD_DIR))" ;\
|
||||
echo "Exportiere die gewaehlte svn-Revision ($(REVISIONS_NR)) ..." ;\
|
||||
svn export . "$(CCD_BUILD_DIR)" | $(EINRUECKEN) ;\
|
||||
else mkdir -p "$(CCD_BUILD_DIR)" ;\
|
||||
make -C documents clean ;\
|
||||
cp -r $(shell ls | grep -v "$(notdir $(TMP_ROOT))" | grep -v "$(notdir $(EXPORT_DIR))") "$(CCD_BUILD_DIR)" ;\
|
||||
fi
|
||||
@echo "Erzeuge source-Archiv ..."
|
||||
@$(ERZEUGE_TAR)
|
||||
|
||||
|
|
|
@ -30,49 +30,37 @@ all: $(EXPORT_DIRS)
|
|||
# copy the created files to the destination directory (usually outside of this directory tree)
|
||||
install: $(EXPORT_DIRS)
|
||||
echo $(EXPORT_DIRS)
|
||||
@if [ -z "$(CCD_BUILD_DIR)" ] ; \
|
||||
then echo "CCD_BUILD_DIR must be defined! (this should be done by the parent Makefile)" >&2 ; \
|
||||
false ; \
|
||||
@if [ -z "$(CCD_BUILD_DIR)" ] ;\
|
||||
then echo "CCD_BUILD_DIR must be defined! (this should be done by the parent Makefile)" >&2 ;\
|
||||
false ;\
|
||||
fi
|
||||
@if [ ! -e "$(CCD_BUILD_DIR)" ] ; \
|
||||
then echo "CCD_BUILD_DIR ($(CCD_BUILD_DIR)) does not exist!" ; \
|
||||
false ; \
|
||||
@if [ ! -e "$(CCD_BUILD_DIR)" ] ;\
|
||||
then echo "CCD_BUILD_DIR ($(CCD_BUILD_DIR)) does not exist!" ;\
|
||||
false ;\
|
||||
fi
|
||||
mkdir -p "$(CCD_BUILD_DIR)/doku/macos"
|
||||
mkdir -p "$(CCD_BUILD_DIR)/doku/linux"
|
||||
mkdir -p "$(CCD_BUILD_DIR)/doku/windows"
|
||||
@# copy os-independent stuff
|
||||
for a in $(EXPORT_DIRS) ; \
|
||||
do if echo "$$(dirname $$a)" | grep -q "/common/" ; \
|
||||
then DIRNAME_MAC="$(CCD_BUILD_DIR)/doku/macos/$$(basename $$(dirname $$a))" ; \
|
||||
DIRNAME_LIN="$(CCD_BUILD_DIR)/doku/linux/$$(basename $$(dirname $$a))" ; \
|
||||
DIRNAME_WIN="$(CCD_BUILD_DIR)/doku/windows/$$(basename $$(dirname $$a))" ; \
|
||||
mkdir -p "$$DIRNAME_MAC" "$$DIRNAME_LIN" "$$DIRNAME_WIN" ; \
|
||||
cp -r "$$a/"* "$$DIRNAME_MAC" ; \
|
||||
cp -r "$$a/"* "$$DIRNAME_LIN" ; \
|
||||
cp -r "$$a/"* "$$DIRNAME_WIN" ; \
|
||||
fi ; \
|
||||
for a in $(EXPORT_DIRS) ;\
|
||||
do if echo "$$(dirname $$a)" | grep -q "/common/" ;\
|
||||
then DIRNAME_MAC="$(CCD_BUILD_DIR)/doku/macos/$$(basename $$(dirname $$a))" ;\
|
||||
DIRNAME_LIN="$(CCD_BUILD_DIR)/doku/linux/$$(basename $$(dirname $$a))" ;\
|
||||
DIRNAME_WIN="$(CCD_BUILD_DIR)/doku/windows/$$(basename $$(dirname $$a))" ;\
|
||||
mkdir -p "$$DIRNAME_MAC" "$$DIRNAME_LIN" "$$DIRNAME_WIN" ;\
|
||||
cp -r "$$a/"* "$$DIRNAME_MAC" ;\
|
||||
cp -r "$$a/"* "$$DIRNAME_LIN" ;\
|
||||
cp -r "$$a/"* "$$DIRNAME_WIN" ;\
|
||||
fi ;\
|
||||
done
|
||||
@# copy os-specific stuff
|
||||
for a in $(EXPORT_DIRS) ; \
|
||||
do if echo "$$(dirname $$a)" | grep -q "/common/" ; \
|
||||
then true ; \
|
||||
else mkdir -p "$(CCD_BUILD_DIR)/doku/$$(dirname $$a)" ; \
|
||||
cp -r "$$a/"* "$(CCD_BUILD_DIR)/doku/$$(dirname $$a)" ; \
|
||||
fi ; \
|
||||
for a in $(EXPORT_DIRS) ;\
|
||||
do if echo "$$(dirname $$a)" | grep -q "/common/" ;\
|
||||
then true ;\
|
||||
else mkdir -p "$(CCD_BUILD_DIR)/doku/$$(dirname $$a)" ;\
|
||||
cp -r "$$a/"* "$(CCD_BUILD_DIR)/doku/$$(dirname $$a)" ;\
|
||||
fi ;\
|
||||
done
|
||||
@# copy general documents
|
||||
#cp -r common $(CCD_BUILD_DIR)/doku/macos
|
||||
#cp -r common $(CCD_BUILD_DIR)/doku/linux
|
||||
#cp -r common $(CCD_BUILD_DIR)/doku/windows
|
||||
@# copy os-specific stuff
|
||||
#cp -r macos/* $(CCD_BUILD_DIR)/doku/macos
|
||||
#cp -r linux/* $(CCD_BUILD_DIR)/doku/linux
|
||||
#cp -r windows/* $(CCD_BUILD_DIR)/doku/windows
|
||||
@# remove unnecessary files (eps, lyx, tex)
|
||||
#find $(CCD_BUILD_DIR)/doku -name \*.tex -exec rm "{}" \;
|
||||
#find $(CCD_BUILD_DIR)/doku -name \*.lyx -exec rm "{}" \;
|
||||
#find $(CCD_BUILD_DIR)/doku -name \*.eps -exec rm "{}" \;
|
||||
|
||||
|
||||
clean-targets:
|
||||
|
|
Loading…
Reference in a new issue