167 lines
5.4 KiB
Makefile
167 lines
5.4 KiB
Makefile
########## Variablendefinitionen ###########
|
|
|
|
# Revision-Variablen
|
|
STABLE_REVISION := 143
|
|
AKTUELLE_REVISION := $(shell svn -R info| grep ^Revision| cut -f2 -d " " | sort | tail -1)
|
|
REVISIONS_SUFFIX = -r$(ARBEITS_REVISION)
|
|
REVISIONS_DATUM = $(shell svn log -r $(ARBEITS_REVISION) -q | grep -v "^---" | cut -d "|" -f 3)
|
|
|
|
# Verzeichnisse
|
|
ROOT_DIR := $(shell pwd)
|
|
EXPORT_DIR = $(ROOT_DIR)/export
|
|
PROG_DIR = $(ROOT_DIR)/programme
|
|
# der Name der export-Archive
|
|
EXPORT_PREFIX := cryptocd
|
|
TMP_ROOT = $(ROOT_DIR)/tmp
|
|
TMP_DIR = $(TMP_ROOT)/$(EXPORT_PREFIX)$(REVISIONS_SUFFIX)$(EXPORT_FILE_SUFFIX)
|
|
EXPORT_FILE = $(EXPORT_DIR)/$(EXPORT_PREFIX)$(REVISIONS_SUFFIX)$(EXPORT_FILE_SUFFIX)
|
|
MIRROR_QUELLE_DIR = $(ROOT_DIR)
|
|
|
|
# Aktionen
|
|
ERZEUGE_MIRROR = _scripts/erzeuge_export_mirror.sh $(MIRROR_QUELLE_DIR) $(TMP_DIR)
|
|
ERZEUGE_TAR = tar cjhf $(EXPORT_FILE).tar.bz2 -C $(dir $(TMP_DIR)) $(notdir $(TMP_DIR))
|
|
ERZEUGE_ZIP = cd $(shell dirname $(TMP_DIR)); zip -9qr $(EXPORT_FILE).zip $(shell basename $(TMP_DIR))
|
|
ERZEUGE_ISO = mkisofs $(ISO_OPTS) -o $(EXPORT_FILE).iso $(TMP_DIR) 2>&1 | $(EINRUECKEN)
|
|
|
|
# Sonstiges
|
|
ISO_OPTS = -iso-level 3 -J -joliet-long -relaxed-filenames -f -r -V $(EXPORT_PREFIX)$(REVISIONS_SUFFIX)
|
|
EINRUECKEN = sed 's/^/\t/'
|
|
|
|
# Voreinstellungen
|
|
ARBEITS_REVISION = $(AKTUELLE_REVISION)
|
|
LINE_STATUS = offline
|
|
EXPORT_FILE_SUFFIX := undefiniert
|
|
# gilt nur fuer "release" und "release_all"
|
|
|
|
|
|
####### Allgemeine targets ###########
|
|
|
|
.PHONY : clean all doku check help website website-stable release release-stable source source-stable export-all erzeuge_mirror release_all release_all-stable setze_releaseinfos hole_svn_export svn_erzeuge_links verlinke_programme verlinke_chaosradio
|
|
|
|
all: doku
|
|
|
|
help:
|
|
@echo "allgemeine Targets:"
|
|
@echo " help - diese Uebersicht"
|
|
@echo " doku - das Doku-Verzeichnis erneuern"
|
|
@echo " all - dasselbe wie 'doku'"
|
|
@echo " clean - unnoetige Dateien loeschen"
|
|
@echo " check - Pruefung der Links"
|
|
@echo
|
|
@echo "Export-Targets:"
|
|
@echo " source[-stable] - die lyx-Quellen und Bilder"
|
|
@echo " release[-stable] - alles ausser Chaosradio"
|
|
@echo " release_all[-stable] - mit Chaosradio-Dateien"
|
|
@echo " website[-stable] - fuer die Webseite: mit Programmen, ohne Chaosradio"
|
|
@echo " export-all - erstellt alle Export-Formen (auch stable)"
|
|
|
|
clean:
|
|
@echo $(ICH)
|
|
-make -C doku clean
|
|
-rm -r $(TMP_ROOT)/* 2>/dev/null
|
|
|
|
check:
|
|
make -C doku
|
|
linkchecker -r 3 --intern='!^mailto:' --extern-strict-all start.html
|
|
|
|
|
|
####### speziell fuer die stable-targets ###########
|
|
|
|
%-stable: ARBEITS_REVISION := $(STABLE_REVISION)
|
|
%-stable: MIRROR_QUELLE_DIR = $(TMP_ROOT)/svn-$(EXPORT_PREFIX)$(REVISIONS_SUFFIX)
|
|
website: LINE_STATUS=online
|
|
|
|
release-stable: release
|
|
release_all-stable: release_all
|
|
source-stable: source
|
|
website-stable: website
|
|
|
|
######## die Werkzeuge #########
|
|
|
|
doku: hole_quell_daten
|
|
@echo "Aktualisiere das Doku-Verzeichnis ..."
|
|
@make -C $(MIRROR_QUELLE_DIR)/doku $(LINE_STATUS)
|
|
|
|
erzeuge_mirror: doku hole_quell_daten
|
|
@echo "Erzeuge lokalen export-Mirror ..."
|
|
@$(ERZEUGE_MIRROR)
|
|
|
|
setze_releaseinfos: erzeuge_mirror
|
|
@echo "Passe version.txt an ..."
|
|
@cat version.txt | sed 's/REVISIONS_PLATZHALTER/$(ARBEITS_REVISION)/g; s/DATUMS_PLATZHALTER/$(REVISIONS_DATUM)/g' >$(TMP_DIR)/version.txt
|
|
@echo "Erzeuge changelog.txt ..."
|
|
@svn log -r $(ARBEITS_REVISION):1 >$(TMP_DIR)/changelog.txt
|
|
@todos $(TMP_DIR)/changelog.txt
|
|
|
|
hole_quell_daten:
|
|
@if [ ! -e "$(MIRROR_QUELLE_DIR)" ] ;\
|
|
then mkdir -p $(shell dirname "$(MIRROR_QUELLE_DIR)") ;\
|
|
echo "Exportiere die gewaehlte svn-Revision ($(ARBEITS_REVISION)) ..." ;\
|
|
svn export -r $(ARBEITS_REVISION) . "$(MIRROR_QUELLE_DIR)" | $(EINRUECKEN) ;\
|
|
else echo "Verwende existierende lokale svn-Kopie" ;\
|
|
fi
|
|
|
|
verlinke_programme: erzeuge_mirror
|
|
@echo "Erzeuge Links zu den Programmen ..."
|
|
@[ -e "$(ROOT_DIR)/programme" ] && ln -s "$(ROOT_DIR)/programme" "$(TMP_DIR)" || (echo "Fehler: kein Programm-Verzeichnis ($(ROOT_DIR)/programme) gefunden!" >&2 ; false )
|
|
|
|
verlinke_chaosradio: erzeuge_mirror
|
|
@echo "Erzeuge Links zu den ChaosRadio-Dateien ..."
|
|
@[ -e "$(ROOT_DIR)/ausLese/chaosradio" ] && ln -s "$(ROOT_DIR)/ausLese/chaosradio" "$(TMP_DIR)/ausLese" || echo "Warnung: keine ChaosRadio-Dateien gefunden ($(ROOT_DIR)/ausLese/chaosradio) - ignoriert" >&2
|
|
|
|
####### die Ausgabe-Formate ###########
|
|
|
|
website: EXPORT_FILE_SUFFIX := _website
|
|
website: erzeuge_mirror verlinke_programme
|
|
@echo "Gruppen-Schreibrecht setzen (fuer eduforge) ..."
|
|
@# fuer die Zugriffsrechte auf dem eduforge-Server
|
|
@chmod -R g+rw $(TMP_ROOT)
|
|
|
|
@echo "Erzeuge Archiv der online-Dateien ..."
|
|
@$(ERZEUGE_TAR)
|
|
|
|
|
|
source: EXPORT_FILE_SUFFIX := _src
|
|
source: TMP_DIR = $(MIRROR_QUELLE_DIR)
|
|
source: hole_quell_daten
|
|
@echo "Erzeuge source-Archiv ..."
|
|
@$(ERZEUGE_TAR)
|
|
|
|
|
|
release: EXPORT_FILE_SUFFIX := _small
|
|
|
|
release_all: EXPORT_FILE_SUFFIX := _all
|
|
release_all: verlinke_chaosradio verlinke_programme
|
|
|
|
release release_all: verlinke_programme setze_releaseinfos
|
|
@echo "Erzeuge zip-Archiv ..."
|
|
@$(ERZEUGE_ZIP)
|
|
@echo "Erzeuge iso-Image ..."
|
|
@$(ERZEUGE_ISO)
|
|
|
|
|
|
export-all:
|
|
@echo "Erstelle website ..."
|
|
@make website
|
|
|
|
#make website-stable
|
|
# klappt nicht wegen des restriktiven diffs
|
|
|
|
@echo "Erstelle aktuelles Quell-Paket ... "
|
|
@make source
|
|
|
|
@echo "Erstelle stabiles Quell-Paket ..."
|
|
@make source-stable
|
|
|
|
@echo "Erstelle kleine aktuelle Release-Pakete ..."
|
|
@make release
|
|
|
|
@echo "Erstelle kleine stabile Release-Pakete ..."
|
|
@make release-stable
|
|
|
|
@echo "Erstelle grosse aktuelle Release-Pakete ..."
|
|
@make release_all
|
|
|
|
@echo "Erstelle grosse stabile Release-Pakete ..."
|
|
@make release_all-stable
|
|
|