kleine Makefile-Verbesserungen fuer nicht-svn-Nutzer

Formatierungskram
This commit is contained in:
lars 2006-07-29 16:23:30 +00:00
parent c0f43c5cf8
commit ba8cd27e60
2 changed files with 41 additions and 44 deletions

View file

@ -1,7 +1,7 @@
########## Variablendefinitionen ########### ########## Variablendefinitionen ###########
# Revisions-Variablen # 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) REVISIONS_SUFFIX = _r$(REVISIONS_NR)
# Verzeichnisse # Verzeichnisse
@ -78,9 +78,9 @@ validate: doku kopiere_programme
# pruefe, ob alle notwendigen/empfohlenen Verzeichnisse existieren # pruefe, ob alle notwendigen/empfohlenen Verzeichnisse existieren
verzeichnisstruktur: $(CREATE_DIRS) verzeichnisstruktur: $(CREATE_DIRS)
$(CREATE_DIRS): $(CREATE_DIRS):
@if [ ! -e "$@" ] ; \ @if [ ! -e "$@" ] ;\
then echo -e "directory ($@) does not exist - I will create it" ; \ then echo -e "directory ($@) does not exist - I will create it" ;\
mkdir -p "$@" ; \ mkdir -p "$@" ;\
fi fi
######## die Werkzeuge ######### ######## die Werkzeuge #########
@ -88,8 +88,11 @@ $(CREATE_DIRS):
cd-template: verzeichnisstruktur cd-template: verzeichnisstruktur
@rm -rf $(CCD_BUILD_DIR) @rm -rf $(CCD_BUILD_DIR)
@# export local svn directory OR just copy the directories (for non-svn users) @# export local svn directory OR just copy the directories (for non-svn users)
@svn export cd-template "$(CCD_BUILD_DIR)" \ @if test -d .svn ;\
|| mkdir -p $(dir $(CCD_BUILD_DIR)) && cp -r cd-template $(CCD_BUILD_DIR) 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 doku: cd-template
@ -117,9 +120,15 @@ website: doku kopiere_programme
source: EXPORT_FILE_SUFFIX := _src source: EXPORT_FILE_SUFFIX := _src
source: source:
@echo "Exportiere die gewaehlte svn-Revision ($(REVISIONS_NR)) ..." ;\ rm -rf "$(CCD_BUILD_DIR)"
rm -rf "$(CCD_BUILD_DIR)" ;\ if test -d .svn ;\
svn export . "$(CCD_BUILD_DIR)" | $(EINRUECKEN) 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 ..." @echo "Erzeuge source-Archiv ..."
@$(ERZEUGE_TAR) @$(ERZEUGE_TAR)

View file

@ -30,49 +30,37 @@ all: $(EXPORT_DIRS)
# copy the created files to the destination directory (usually outside of this directory tree) # copy the created files to the destination directory (usually outside of this directory tree)
install: $(EXPORT_DIRS) install: $(EXPORT_DIRS)
echo $(EXPORT_DIRS) echo $(EXPORT_DIRS)
@if [ -z "$(CCD_BUILD_DIR)" ] ; \ @if [ -z "$(CCD_BUILD_DIR)" ] ;\
then echo "CCD_BUILD_DIR must be defined! (this should be done by the parent Makefile)" >&2 ; \ then echo "CCD_BUILD_DIR must be defined! (this should be done by the parent Makefile)" >&2 ;\
false ; \ false ;\
fi fi
@if [ ! -e "$(CCD_BUILD_DIR)" ] ; \ @if [ ! -e "$(CCD_BUILD_DIR)" ] ;\
then echo "CCD_BUILD_DIR ($(CCD_BUILD_DIR)) does not exist!" ; \ then echo "CCD_BUILD_DIR ($(CCD_BUILD_DIR)) does not exist!" ;\
false ; \ false ;\
fi fi
mkdir -p "$(CCD_BUILD_DIR)/doku/macos" mkdir -p "$(CCD_BUILD_DIR)/doku/macos"
mkdir -p "$(CCD_BUILD_DIR)/doku/linux" mkdir -p "$(CCD_BUILD_DIR)/doku/linux"
mkdir -p "$(CCD_BUILD_DIR)/doku/windows" mkdir -p "$(CCD_BUILD_DIR)/doku/windows"
@# copy os-independent stuff @# copy os-independent stuff
for a in $(EXPORT_DIRS) ; \ for a in $(EXPORT_DIRS) ;\
do if echo "$$(dirname $$a)" | grep -q "/common/" ; \ do if echo "$$(dirname $$a)" | grep -q "/common/" ;\
then DIRNAME_MAC="$(CCD_BUILD_DIR)/doku/macos/$$(basename $$(dirname $$a))" ; \ then DIRNAME_MAC="$(CCD_BUILD_DIR)/doku/macos/$$(basename $$(dirname $$a))" ;\
DIRNAME_LIN="$(CCD_BUILD_DIR)/doku/linux/$$(basename $$(dirname $$a))" ; \ DIRNAME_LIN="$(CCD_BUILD_DIR)/doku/linux/$$(basename $$(dirname $$a))" ;\
DIRNAME_WIN="$(CCD_BUILD_DIR)/doku/windows/$$(basename $$(dirname $$a))" ; \ DIRNAME_WIN="$(CCD_BUILD_DIR)/doku/windows/$$(basename $$(dirname $$a))" ;\
mkdir -p "$$DIRNAME_MAC" "$$DIRNAME_LIN" "$$DIRNAME_WIN" ; \ mkdir -p "$$DIRNAME_MAC" "$$DIRNAME_LIN" "$$DIRNAME_WIN" ;\
cp -r "$$a/"* "$$DIRNAME_MAC" ; \ cp -r "$$a/"* "$$DIRNAME_MAC" ;\
cp -r "$$a/"* "$$DIRNAME_LIN" ; \ cp -r "$$a/"* "$$DIRNAME_LIN" ;\
cp -r "$$a/"* "$$DIRNAME_WIN" ; \ cp -r "$$a/"* "$$DIRNAME_WIN" ;\
fi ; \ fi ;\
done done
@# copy os-specific stuff @# copy os-specific stuff
for a in $(EXPORT_DIRS) ; \ for a in $(EXPORT_DIRS) ;\
do if echo "$$(dirname $$a)" | grep -q "/common/" ; \ do if echo "$$(dirname $$a)" | grep -q "/common/" ;\
then true ; \ then true ;\
else mkdir -p "$(CCD_BUILD_DIR)/doku/$$(dirname $$a)" ; \ else mkdir -p "$(CCD_BUILD_DIR)/doku/$$(dirname $$a)" ;\
cp -r "$$a/"* "$(CCD_BUILD_DIR)/doku/$$(dirname $$a)" ; \ cp -r "$$a/"* "$(CCD_BUILD_DIR)/doku/$$(dirname $$a)" ;\
fi ; \ fi ;\
done 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: clean-targets: