cryptocd/Makefile

149 lines
4.3 KiB
Makefile
Raw Normal View History

2005-04-23 22:35:52 +02:00
########## Variablendefinitionen ###########
2005-12-12 21:47:35 +01:00
# Revisions-Variablen
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)
2005-04-23 22:35:52 +02:00
# Verzeichnisse
ROOT_DIR := $(shell pwd)
# Ablage der erstellten zip/iso-Dateien
EXPORT_DIR = $(ROOT_DIR)/export
# so beginnt das export-Verzeichnis
2005-04-23 22:35:52 +02:00
EXPORT_PREFIX := cryptocd
2005-12-12 21:47:35 +01:00
# wird an das export-Verzeichnis und die Archiv/iso-Dateien angehaengt
EXPORT_FILE_SUFFIX :=
EXPORT_FILE = $(EXPORT_DIR)/$(EXPORT_PREFIX)$(REVISIONS_SUFFIX)$(EXPORT_FILE_SUFFIX)
# Zwischenlagerung
2005-04-23 22:35:52 +02:00
TMP_ROOT = $(ROOT_DIR)/tmp
2005-12-12 21:47:35 +01:00
CCD_BUILD_DIR = $(TMP_ROOT)/$(EXPORT_PREFIX)$(REVISIONS_SUFFIX)$(EXPORT_FILE_SUFFIX)
PROGRAMM_DIR = $(CCD_BUILD_DIR)/programme
2005-12-12 21:47:35 +01:00
# Verzeichnisse, die notfalls erstellt werden muessen
CREATE_DIRS = $(TMP_ROOT) $(EXPORT_DIR)
2005-04-23 22:35:52 +02:00
# Aktionen
2005-04-24 14:46:10 +02:00
ERZEUGE_TAR = tar cjhf $(EXPORT_FILE).tar.bz2 -C $(dir $(CCD_BUILD_DIR)) $(notdir $(CCD_BUILD_DIR))
ERZEUGE_ZIP = (cd $(dir $(CCD_BUILD_DIR)); zip -9rq - $(notdir $(CCD_BUILD_DIR))) >$(EXPORT_FILE).zip
2005-12-12 21:47:35 +01:00
ERZEUGE_ISO = mkisofs -quiet $(ISO_OPTS) -o $(EXPORT_FILE).iso $(CCD_BUILD_DIR) 2>&1 | $(EINRUECKEN)
2005-04-23 22:35:52 +02:00
# Sonstiges
# Optionen fuer mkisofs
2005-04-23 22:35:52 +02:00
ISO_OPTS = -iso-level 3 -J -joliet-long -relaxed-filenames -f -r -V $(EXPORT_PREFIX)$(REVISIONS_SUFFIX)
# Ausgabe-Filter zum Einruecken
2005-04-23 22:35:52 +02:00
EINRUECKEN = sed 's/^/\t/'
2005-12-12 21:47:35 +01:00
######### Variablen vererben ###########
export CCD_BUILD_DIR
2005-04-23 22:35:52 +02:00
########### Allgemeine targets ###########
2005-04-23 22:35:52 +02:00
.PHONY : clean clean-dist all documents linkcheck help website release source all cd-template kopiere_programme
2005-04-23 22:35:52 +02:00
help:
@echo "allgemeine Targets:"
@echo " help - diese Uebersicht"
@echo " doku - das Doku-Verzeichnis erneuern"
@echo " clean - unnoetige Dateien loeschen (ohne downloads)"
@echo " dist-clean - unnoetige Dateien loeschen (inklusive downloads)"
@echo " linkcheck - Pruefung der Links"
2005-12-12 21:47:35 +01:00
@echo " validate - Pruefung des html-Codes"
2005-04-23 22:35:52 +02:00
@echo
@echo "Export-Targets:"
@echo " source - die lyx-Quellen und Bilder"
@echo " website - fuer die Webseite: mit Programmen"
@echo " release - erstellt das iso-Image und das zip-Archiv"
2005-12-12 21:47:35 +01:00
@echo " all - erstellt alle Export-Formen"
2005-04-23 22:35:52 +02:00
2005-04-23 22:35:52 +02:00
clean:
-make -C documents clean
2006-07-27 02:10:18 +02:00
-rm -rf $(TMP_ROOT)/* 2>/dev/null
dist-clean: clean
@# runtergeladene Dateien loeschen
@downloads/get_files.sh programme clean
2005-12-12 21:47:35 +01:00
2005-04-23 22:35:52 +02:00
linkcheck: doku kopiere_programme
linkchecker -r 4 --ignore-url=^mailto: $(CCD_BUILD_DIR)/start.html
validate:
make -C documents validate
2005-04-23 22:35:52 +02:00
2005-12-12 21:47:35 +01:00
# pruefe, ob alle notwendigen/empfohlenen Verzeichnisse existieren
2005-12-12 21:47:35 +01:00
verzeichnisstruktur: $(CREATE_DIRS)
$(CREATE_DIRS):
@if [ ! -e "$@" ] ;\
then echo -e "directory ($@) does not exist - I will create it" ;\
mkdir -p "$@" ;\
fi
2005-04-23 22:35:52 +02:00
######## die Werkzeuge #########
2005-04-24 14:46:10 +02:00
cd-template: verzeichnisstruktur
@rm -rf $(CCD_BUILD_DIR)
2006-07-27 02:10:18 +02:00
@# export local svn directory OR just copy the directories (for non-svn users)
@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
2005-04-23 22:35:52 +02:00
2005-04-24 14:46:10 +02:00
doku: cd-template
@echo "Aktualisiere das Doku-Verzeichnis ..."
@make -C documents
2005-12-12 21:47:35 +01:00
@#Kopieren der Dateien ins das Abbild-Verzeichnis
@make -C documents install
2005-04-23 22:35:52 +02:00
2005-12-12 21:47:35 +01:00
kopiere_programme: cd-template
@echo "Kopiere die Programme ..."
@downloads/get_files.sh programme download
@downloads/get_files.sh programme verify
@downloads/get_files.sh programme install "$(PROGRAMM_DIR)"
2005-04-23 22:35:52 +02:00
####### die Ausgabe-Formate ###########
website: EXPORT_FILE_SUFFIX := _website
2005-12-12 21:47:35 +01:00
website: doku kopiere_programme
2005-04-23 22:35:52 +02:00
@echo "Erzeuge Archiv der online-Dateien ..."
@# Gruppen-Schreibrecht setzen (fuer eduforge)
@chmod -R g+rw $(TMP_ROOT)
2005-04-23 22:35:52 +02:00
@$(ERZEUGE_TAR)
source: EXPORT_FILE_SUFFIX := _src
source:
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
2005-04-23 22:35:52 +02:00
@echo "Erzeuge source-Archiv ..."
@$(ERZEUGE_TAR)
release: EXPORT_FILE_SUFFIX := _release
release: doku kopiere_programme
2005-04-23 22:35:52 +02:00
@echo "Erzeuge iso-Image ..."
@$(ERZEUGE_ISO)
@echo "Erzeuge zip-Archiv ..."
@$(ERZEUGE_ZIP)
2005-04-23 22:35:52 +02:00
2005-12-12 21:47:35 +01:00
all:
2005-04-23 22:35:52 +02:00
@make website
@make release
@make source
2005-04-23 22:35:52 +02:00