152 lines
4.2 KiB
Makefile
152 lines
4.2 KiB
Makefile
|
########## Variablendefinitionen ###########
|
||
|
|
||
|
# Revisions-Variablen
|
||
|
REVISIONS_NR := $(shell svn -R info| grep ^Revision| cut -f2 -d " " | sort | tail -1)
|
||
|
REVISIONS_SUFFIX = _r$(REVISIONS_NR)
|
||
|
|
||
|
# Verzeichnisse
|
||
|
ROOT_DIR := $(shell pwd)
|
||
|
|
||
|
# Ablage der erstellten zip/iso-Dateien
|
||
|
EXPORT_DIR = $(ROOT_DIR)/export
|
||
|
# so beginnt das export-Verzeichnis
|
||
|
EXPORT_PREFIX := cryptocd
|
||
|
# wird an das export-Verzeichnis und die Archiv/iso-Dateien angehaengt
|
||
|
EXPORT_FILE_SUFFIX := undefiniert
|
||
|
EXPORT_FILE = $(EXPORT_DIR)/$(EXPORT_PREFIX)$(REVISIONS_SUFFIX)$(EXPORT_FILE_SUFFIX)
|
||
|
|
||
|
# Zwischenlagerung
|
||
|
TMP_ROOT = $(ROOT_DIR)/tmp
|
||
|
CCD_BUILD_DIR = $(TMP_ROOT)/$(EXPORT_PREFIX)$(REVISIONS_SUFFIX)$(EXPORT_FILE_SUFFIX)
|
||
|
PROGRAMM_DIR = $(CCD_BUILD_DIR)/programme
|
||
|
|
||
|
# Verzeichnisse, die notfalls erstellt werden muessen
|
||
|
CREATE_DIRS = $(TMP_ROOT) $(EXPORT_DIR)
|
||
|
|
||
|
# Aktionen
|
||
|
ERZEUGE_TAR = tar cjhf $(EXPORT_FILE).tar.bz2 -C $(dir $(CCD_BUILD_DIR)) $(notdir $(CCD_BUILD_DIR))
|
||
|
ERZEUGE_ISO = mkisofs -quiet $(ISO_OPTS) -o $(EXPORT_FILE).iso $(CCD_BUILD_DIR) 2>&1 | $(EINRUECKEN)
|
||
|
|
||
|
# Sonstiges
|
||
|
# Optionen fuer mkisofs
|
||
|
ISO_OPTS = -iso-level 3 -J -joliet-long -relaxed-filenames -f -r -V $(EXPORT_PREFIX)$(REVISIONS_SUFFIX)
|
||
|
# Ausgabe-Filter zum Einruecken
|
||
|
EINRUECKEN = sed 's/^/\t/'
|
||
|
|
||
|
######### Variablen vererben ###########
|
||
|
export CCD_BUILD_DIR
|
||
|
|
||
|
########### Allgemeine targets ###########
|
||
|
|
||
|
.PHONY : clean all documents check help website doku-release release source all cd-template kopiere_programme
|
||
|
|
||
|
help:
|
||
|
@echo "allgemeine Targets:"
|
||
|
@echo " help - diese Uebersicht"
|
||
|
@echo " doku - das Doku-Verzeichnis erneuern"
|
||
|
@echo " clean - unnoetige Dateien loeschen"
|
||
|
@echo " check - Pruefung der Links"
|
||
|
@echo " validate - Pruefung des html-Codes"
|
||
|
@echo
|
||
|
@echo "Export-Targets:"
|
||
|
@echo " source - die lyx-Quellen und Bilder"
|
||
|
@echo " website - fuer die Webseite: mit Programmen, ohne Chaosradio"
|
||
|
@echo " doku-release - alles ausser Chaosradio"
|
||
|
@echo " release - mit Chaosradio-Dateien"
|
||
|
@echo " all - erstellt alle Export-Formen"
|
||
|
|
||
|
clean:
|
||
|
@echo $(ICH)
|
||
|
-make -C documents clean
|
||
|
-rm -r $(TMP_ROOT)/* 2>/dev/null
|
||
|
@downloads/get_files.sh clean
|
||
|
|
||
|
|
||
|
check:
|
||
|
make -C documents
|
||
|
linkchecker -r 3 --intern='!^mailto:' --extern-strict-all start.html
|
||
|
|
||
|
validate:
|
||
|
make -C documents
|
||
|
validate documents/_output/*.html
|
||
|
|
||
|
# 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 "$@" ; \
|
||
|
fi
|
||
|
|
||
|
######## die Werkzeuge #########
|
||
|
|
||
|
cd-template: verzeichnisstruktur
|
||
|
@rm -rf $(CCD_BUILD_DIR)
|
||
|
@svn export cd-template "$(CCD_BUILD_DIR)"
|
||
|
|
||
|
|
||
|
doku: cd-template
|
||
|
@echo "Aktualisiere das Doku-Verzeichnis ..."
|
||
|
@make -C documents
|
||
|
@#Kopieren der Dateien ins das Abbild-Verzeichnis
|
||
|
@make -C documents install
|
||
|
|
||
|
|
||
|
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)"
|
||
|
|
||
|
|
||
|
####### die Ausgabe-Formate ###########
|
||
|
website: EXPORT_FILE_SUFFIX := _website
|
||
|
website: doku kopiere_programme
|
||
|
@echo "Gruppen-Schreibrecht setzen (fuer eduforge) ..."
|
||
|
@chmod -R g+rw $(TMP_ROOT)
|
||
|
@echo "Erzeuge Archiv der online-Dateien ..."
|
||
|
@$(ERZEUGE_TAR)
|
||
|
|
||
|
|
||
|
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)
|
||
|
@echo "Erzeuge source-Archiv ..."
|
||
|
@$(ERZEUGE_TAR)
|
||
|
|
||
|
|
||
|
doku-release: EXPORT_FILE_SUFFIX := _doku
|
||
|
doku-release: ZIP_DIR := $(CCD_BUILD_DIR)/$(EXPORT_PREFIX)-doku$(REVISIONS_SUFFIX)
|
||
|
doku-release: doku
|
||
|
@echo "Kopiere die Doku-Dateien ..."
|
||
|
@rm -rf "$(ZIP_DIR)"
|
||
|
@rm -f "$(EXPORT_FILE).zip"
|
||
|
@cp -r "$(CCD_BUILD_DIR)/doku" "$(ZIP_DIR)"
|
||
|
@echo "Erzeuge zip-Archiv ..."
|
||
|
@cd "$(dir $(ZIP_DIR))"; zip -9qr "$(EXPORT_FILE).zip" "$(notdir $(ZIP_DIR))"
|
||
|
@rm -rf "$(ZIP_DIR)"
|
||
|
|
||
|
|
||
|
release: EXPORT_FILE_SUFFIX := _release
|
||
|
release: doku kopiere_programme
|
||
|
@echo "Erzeuge iso-Image ..."
|
||
|
@$(ERZEUGE_ISO)
|
||
|
|
||
|
|
||
|
all:
|
||
|
@echo "Erstelle die Web-Seite ..."
|
||
|
@make website
|
||
|
|
||
|
@echo "Erstelle das Doku-Paket ..."
|
||
|
@make doku-release
|
||
|
|
||
|
@echo "Erstelle das Release-Paket ..."
|
||
|
@make release
|
||
|
|
||
|
@echo "Erstelle das Quell-Paket ... "
|
||
|
@make source
|
||
|
|