cryptocd/Makefile

157 lines
4.4 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 svn -R info| grep ^Revision| cut -f2 -d " " | sort | tail -1)
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))
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 check help website doku-release 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)"
2005-04-23 22:35:52 +02:00
@echo " check - 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, ohne Chaosradio"
@echo " doku-release - alles ausser Chaosradio"
@echo " release - mit Chaosradio-Dateien"
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:
@echo $(ICH)
-make -C documents clean
2005-04-23 22:35:52 +02:00
-rm -r $(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
check: doku kopiere_programme
linkchecker -r 4 --ignore-url=^mailto: $(CCD_BUILD_DIR)/start.html
validate: doku kopiere_programme
validate $(CCD_BUILD_DIR)/doku/*.html
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 "$@" ] ; \
2005-12-12 21:47:35 +01:00
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)
2005-12-12 21:47:35 +01:00
@svn export cd-template "$(CCD_BUILD_DIR)"
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 "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:
2005-12-12 21:47:35 +01:00
@echo "Exportiere die gewaehlte svn-Revision ($(REVISIONS_NR)) ..." ;\
rm -rf "$(CCD_BUILD_DIR)" ;\
svn export . "$(CCD_BUILD_DIR)" | $(EINRUECKEN)
2005-04-23 22:35:52 +02:00
@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)"
2005-04-23 22:35:52 +02:00
@echo "Erzeuge zip-Archiv ..."
@cd "$(dir $(ZIP_DIR))"; zip -9qr "$(EXPORT_FILE).zip" "$(notdir $(ZIP_DIR))"
@rm -rf "$(ZIP_DIR)"
2005-12-12 21:47:35 +01:00
release: EXPORT_FILE_SUFFIX := _release
release: doku kopiere_programme
2005-04-23 22:35:52 +02:00
@echo "Erzeuge iso-Image ..."
@$(ERZEUGE_ISO)
2005-12-12 21:47:35 +01:00
all:
@echo "Erstelle die Web-Seite ..."
2005-04-23 22:35:52 +02:00
@make website
@echo "Erstelle das Doku-Paket ..."
@make doku-release
2005-04-23 22:35:52 +02:00
@echo "Erstelle das Release-Paket ..."
@make release
2005-04-23 22:35:52 +02:00
@echo "Erstelle das Quell-Paket ... "
@make source
2005-04-23 22:35:52 +02:00