diff -Naur wormux/src/Makefile wormux-new/src/Makefile --- wormux/src/Makefile 2004-06-20 17:43:33.000000000 -0400 +++ wormux-new/src/Makefile 2004-06-22 23:18:42.613548712 -0400 @@ -33,8 +33,8 @@ # Vérifie qu'on a toutes les librairies nécessaires checklib: - @pkg-config clanlib --libs 1>/dev/null 2>&1 \ - || (echo -e $(ERREUR_CLANLIB); exit 1) +# @pkg-config clanlib --libs 1>/dev/null 2>&1 \ +# || (echo -e $(ERREUR_CLANLIB); exit 1) @pkg-config libxml++-1.0 --libs 1>/dev/null 2>&1 \ || (echo -e $(ERREUR_LIBXMLPLUSPLUS); exit 1) diff -Naur wormux/src/Makefile.orig wormux-new/src/Makefile.orig --- wormux/src/Makefile.orig 1969-12-31 19:00:00.000000000 -0500 +++ wormux-new/src/Makefile.orig 2004-06-20 17:43:33.000000000 -0400 @@ -0,0 +1,262 @@ +############################################################################### +# Makefile GENERAL de Wormux +# Par STINNER Victor (Haypo) - http://www.haypocalc.com/ +############################################################################### + +# Défintions communes +include make.env + +ifndef ERREUR +############################################################################### + +# Rêgle par défaut : compile tout +all: compile_debut checklib i18n_mo $(BIN) compile_fin + +# Compile en mode release +release: compile_debut checklib i18n_mo $(BIN) strip compile_fin +strip: + @echo "o Nettoie le binaire (strip)" + @strip $(BIN) + +# Message d'accueil +compile_debut: + @echo -e $(call SEPARATEUR,"(début compilation)") + @echo +ifdef RELEASE + @echo -e $(call TITRE,"Compilation de Wormux (RELEASE)") + @echo + @echo -e "CXXFLAGS =" $(call GRAS,$(CXXFLAGS)) +else + @echo -e $(call TITRE,"Compilation de Wormux (DEBUG)") +endif + @echo + +# Vérifie qu'on a toutes les librairies nécessaires +checklib: + @pkg-config clanlib --libs 1>/dev/null 2>&1 \ + || (echo -e $(ERREUR_CLANLIB); exit 1) + @pkg-config libxml++-1.0 --libs 1>/dev/null 2>&1 \ + || (echo -e $(ERREUR_LIBXMLPLUSPLUS); exit 1) + +# Affiche des informations sur la compilation +info: + @echo -e $(call TITRE,"Wormux version" $(call GRAS,$(VERSION))) + @echo +ifdef LINUX + @echo -e "Compilation sous" $(call GRAS,"Linux") +else + @echo -e "Compilation sous" $(call GRAS,"Windows") +endif + @echo -e "CXX =" $(call GRAS,$(CXX)) + @echo + @echo -e "CXXFLAGS =" $(call GRAS,$(CXXFLAGS)) + @echo + @echo -e "LIBS =" $(call GRAS,$(LIBS)) + @echo + +# Compilation proprement dite, puis liaison +$(BIN): $(OBJECTS) + @echo -e "o Lie le tout dans" $(call GRAS,$(BIN)) + @$(CXX) -o $(BIN) $(CXXFLAGS) $(LIBS) $(OBJECTS) + +# Generate .mo file +i18n_mo: $(MO_FR) +$(MO_FR): $(PO_FR) + @echo -e "Generate "$(call GRAS,$(MO_FR))" file" + @msgfmt $(PO_FR) -o $(MO_FR) + +# Message de fin de compilation +compile_fin: + @echo + @echo -e $(call TITRE,"Compilation terminée") + @echo + @echo -e "Lancez Wormux en tapant :" $(call GRAS,$(dir $(BIN))$(notdir $(BIN))) + @echo -e "Vous pouvez aussi utiliser" $(call GRAS,"make exec") + @echo -e "(ou make qexec pour eviter la liaison)" + @echo -e $(call SEPARATEUR,"(fin compilation)") + +# Créer une archive tgz du programme +# Options de tar : +# -cvf : Create Verbose File= +# -C : Change directory +# -z : Passe à travers gzip +tgz-bin: release + @echo -e $(call SEPARATEUR,"(début archivage)") + @echo + @echo -e $(call TITRE,"Creer l'archive binaire") + @echo + @rm -f $(ARCHIVE_BIN) + @echo -e "o Fichier :" $(call GRAS,$(ARCHIVE_BIN)) + @echo + @echo -e "(en cas d'erreur, verifiez que le répertoire principal de Wormux s'appelle bien 'wormux')" + tar -czf $(ARCHIVE_BIN) -C ../../ $(addprefix wormux/,$(INCLU_TGZ_BIN)) $(EXCLU_TGZ_BIN) + @echo + @echo -e "Taille de l'archive =" \ + $(call GRAS,$(call TAILLE_FICHIER,$(ARCHIVE_BIN))) + @echo + @echo -e $(call SEPARATEUR,"(fin archivage)") + +# Créer une archive tgz des sources (voir la regle 'tgz' pour plus d'infos) +tgz-src: + @echo -e $(call SEPARATEUR,"(début archivage)") + @echo + @echo -e $(call TITRE,"Creer l'archive source") + @echo + @rm -f $(ARCHIVE_SRC) + @echo -e "Fichier :" $(call GRAS,$(ARCHIVE_SRC)) + @echo + @echo -e "(en cas d'erreur, verifiez que le répertoire principal de Wormux s'appelle bien 'wormux')" + @tar -czf $(ARCHIVE_SRC) -C ../../ \ + $(addprefix wormux/,$(INCLU_TGZ_SRC)) $(EXCLU_TGZ_SRC) + @echo + @echo -e "Taille de l'archive =" \ + $(call GRAS,$(call TAILLE_FICHIER,$(ARCHIVE_SRC))) + @echo + @echo -e $(call SEPARATEUR,"(fin archivage)") + +# Nettoyage : Efface les binaires et temporaires +clean: + @echo -e $(call SEPARATEUR,"(début du nettoyage)") + @echo + @echo -e $(call TITRE,"Nettoyage") + @echo + rm -f $(shell find ../ $(FICH_TMP_FIND)) + @echo + @echo -n "Pour effacer les objets et binaire, " + @echo "tapez make cleanall" + @echo + @echo -e $(call SEPARATEUR,"(fin du nettoyage)") + +# Nettoyage : Efface les binaires et temporaires +cleanall: clean + @echo -e $(call SEPARATEUR,"(début du gros nettoyage)") + @echo + @echo -e $(call TITRE,"Nettoyage") + @echo + rm -f *.o $(BIN) + @echo + @echo -e $(call SEPARATEUR,"(fin du gros nettoyage)") + +### Compile, puis exécute Wormux ### +exec: all qexec + +### Exécute Wormux, sans recompilation ### +qexec: + @echo -e $(call SEPARATEUR,"(exécution)") +ifdef LINUX + @(cd $(dir $(BIN)); ./$(notdir $(BIN));) +else + @cd $(dir $(BIN)) + @$(notdir $(BIN)) +endif + @echo -e $(call SEPARATEUR,"(fin d'exécution)") + +# Installation +pre_install: + @touch constante.cpp + +install: CXXFLAGS += -DINSTALL_DIR=\"$(DIR_SHARE)\" +install: pre_install release all + @echo -e $(call SEPARATEUR,"(début installation)") + @echo + @echo -e $(call TITRE,"Installation de Wormux") + @echo + @echo -e "Répetoire d'installation" $(call GRAS,$(DIR_OK)) + @echo + @$(WARNING_ROOT) + @echo + @echo -e "Création du répetoire" $(call GRAS,$(DIR_BIN)) + @mkdir -p $(DIR_BIN) + @echo -e "Création du répetoire" $(call GRAS,$(DIR_SHARE)) + @mkdir -p $(DIR_SHARE) + @echo + + @echo -e "Nettoyage du répertoire" $(call GRAS,$(DIR_SHARE)) + @rm -rf $(DIR_SHARE)* + @echo + + @echo -e "Copie du binaire." + @cp $(BIN) $(DIR_BIN) + @echo -e "Copie des données." + @cp -R ../donnee/* $(DIR_SHARE) + @echo + + @echo -e "Change les droits des fichiers" + @find $(DIR_SHARE) -type f -exec chmod 755 {} \; + @echo -e "Change les droits des répertoires." + @find $(DIR_SHARE) -type d -exec chmod 755 {} \; + @echo + + @echo -e $(call GRAS,"Installation de Wormux terminée !") + @echo + @echo -e $(call SEPARATEUR,"(début installation)") + +# Désinstallation +uninstall: + @echo -e $(call SEPARATEUR,"(début désinstallation)") + @echo + @echo -e $(call TITRE,"Désinstallation de Wormux") + @echo + @echo -e "Répertoire d'installation :" $(call GRAS,$(DIR_OK)) + @$(WARNING_ROOT) + @echo -e "o Suppression de" $(call GRAS,$(DIR_BIN)$(notdir $(BIN))) + @rm -rf $(DIR_BIN)$(notdir $(BIN)) + + @echo -e "o Suppression de" $(call GRAS,$(DIR_SHARE)) + @rm -rf $(DIR_SHARE) + + @echo + @echo -e $(call GRAS,"Fin de la désinstallation de Wormux terminée")"." + @echo + @echo -e $(call SEPARATEUR,"(fin désinstallation)") + +# Génération du nouveau fichier .pot +i18n_pot: $(I18N_POT) +$(I18N_POT): $(SOURCES) + @echo -e $(call SEPARATEUR,"(début fichier .pot)") + @echo + @echo -e "Creation du fichier" $(call GRAS,$(I18N_POT)) + @xgettext -o $(I18N_POT) $(SOURCES) -k'_' -s \ + --force --from-code iso-8859-1 + @echo + @echo -e $(call SEPARATEUR,"(fin fichier .pot)") + +# Génération des dépendances des fichiers sources +# Utilise "gcc -MM" +%.d: %.cpp + @echo -e "o Calcule les dependences de" $(call GRAS,$<) + @$(CC) -MM $< >$@.tmp \ + && sed -e 's/\.o/.d/' <$@.tmp >$@\ + && cat $@.tmp >>$@\ + && rm -f $@.tmp + @echo -e "\t"'@echo -e "o Compile" $$(call GRAS,$<)\\'"\n"\ + "\t"'&& $$(CXX) -o $(<:.cpp=.o) -c $< $$(CXXFLAGS)' >>$@ + +ifdef NEED_DEPEND + +# Inclusion des dépendances +# Si elles n'existent pas, les génère :-) +-include $(DEPENDS) + +endif + +ifdef NEED_OBJECT_RULE + +# Rêgle par défaut pour la compilation +%.o: %.cpp + @echo -e "o Compile" $(call GRAS,$<) + @$(CXX) -o $@ -c $< $(CXXFLAGS) + +endif + +############################################################################### + +# Erreur +else + +%: all +all: + @echo -e $(ERREUR) + @exit 1 + +endif diff -Naur wormux/src/Makefile.rej wormux-new/src/Makefile.rej --- wormux/src/Makefile.rej 1969-12-31 19:00:00.000000000 -0500 +++ wormux-new/src/Makefile.rej 2004-06-22 23:15:20.025346800 -0400 @@ -0,0 +1,19 @@ +*************** +*** 30,37 **** + + # Vérifie qu'on a toutes les librairies nécessaires + checklib: +- @clanlib-config --libs 1>/dev/null 2>&1 \ +- || (echo -e $(ERREUR_CLANLIB); exit 1) + @pkg-config libxml++-1.0 --libs 1>/dev/null 2>&1 \ + || (echo -e $(ERREUR_LIBXMLPLUSPLUS); exit 1) + +--- 30,37 ---- + + # Vérifie qu'on a toutes les librairies nécessaires + checklib: ++ # @clanlib-config --libs 1>/dev/null 2>&1 \ ++ # || (echo -e $(ERREUR_CLANLIB); exit 1) + @pkg-config libxml++-1.0 --libs 1>/dev/null 2>&1 \ + || (echo -e $(ERREUR_LIBXMLPLUSPLUS); exit 1) + diff -Naur wormux/src/make.env wormux-new/src/make.env --- wormux/src/make.env 2004-06-20 19:27:22.000000000 -0400 +++ wormux-new/src/make.env 2004-06-22 23:18:02.731611688 -0400 @@ -52,7 +52,7 @@ # -g : Rajoute les informations de débogage (pour utiliser GDB) # -ansi : Rejette le code non-ANSI # -pedantic : Rejette le code non-ANSI, mais vraiment tout ! -CXXFLAGS:=$(shell pkg-config clanlib --cflags 2>/dev/null) +CXXFLAGS:= CXXFLAGS+=$(shell pkg-config libxml++-1.0 --cflags 2>/dev/null) CXXFLAGS+=-Wall ifdef RELEASE @@ -69,7 +69,7 @@ LINUX=1 # Librairies -LIBS=$(shell pkg-config clanlib --libs 2>/dev/null) +LIBS=-L/usr/lib/clanlib-0.6.5 -lclanCore -clanApp LIBS+=$(shell pkg-config libxml++-1.0 --libs 2>/dev/null) LIBS+=-lclanDisplay -lclanJPEG -lclanPNG -lclanSound -lclanVorbis diff -Naur wormux/src/make.env.orig wormux-new/src/make.env.orig --- wormux/src/make.env.orig 1969-12-31 19:00:00.000000000 -0500 +++ wormux-new/src/make.env.orig 2004-06-20 19:27:22.000000000 -0400 @@ -0,0 +1,199 @@ +############################################################################### +# Définitons communes pour les différents makefile de Wormux +# Par STINNER Victor (Haypo) - http://www.haypocalc.com/ +############################################################################### + +# Version de Wormux +VERSION=$(shell grep 'VERSION' constante.cpp \ + | sed -e 's/.*"\([^"]\+\)".*/\1/') + +# Compilateur C++ +CXX:=g++ + +############################################################################### +# De quoi a-t-on besoin ? (en fonction de la rêgle) + +ifeq ($(MAKECMDGOALS),release) + RELEASE=1 + NEED_OBJECT_RULE=1 +endif +ifeq ($(MAKECMDGOALS),tgz-bin) + RELEASE=1 + NEED_OBJECT_RULE=1 +endif +ifeq ($(MAKECMDGOALS),install) + RELEASE=1 + NEED_OBJECT_RULE=1 +endif + +ifeq ($(MAKECMDGOALS),) + NEED_DEPEND=1 +endif +ifeq ($(MAKECMDGOALS),all) + NEED_DEPEND=1 +endif +ifeq ($(MAKECMDGOALS),$(BIN)) + NEED_DEPEND=1 +endif +ifeq ($(MAKECMDGOALS),exec) + NEED_DEPEND=1 +endif +ifneq ($(findstring .o,$(MAKECMDGOALS)),) + NEED_DEPEND=1 +endif + +############################################################################### + +# Utilise les séquences d'échappement ? +UTILISE_ESC=$(shell if [ "$$EMACS" == "t" ]; then echo '0'; else echo '1'; fi) + +# Options de compilation C++ +# -Wall : Affiche tous les avertissments +# -g : Rajoute les informations de débogage (pour utiliser GDB) +# -ansi : Rejette le code non-ANSI +# -pedantic : Rejette le code non-ANSI, mais vraiment tout ! +CXXFLAGS:=$(shell pkg-config clanlib --cflags 2>/dev/null) +CXXFLAGS+=$(shell pkg-config libxml++-1.0 --cflags 2>/dev/null) +CXXFLAGS+=-Wall +ifdef RELEASE + CXXFLAGS += -O3 -DRELEASE +else + CXXFLAGS += -O0 -g +endif + +# Répertoires d'inclusion +INCDIR:= +CXXFLAGS+=$(INCDIR) + +# LINUX=`uname -s` == "Linux" +LINUX=1 + +# Librairies +LIBS=$(shell pkg-config clanlib --libs 2>/dev/null) +LIBS+=$(shell pkg-config libxml++-1.0 --libs 2>/dev/null) +LIBS+=-lclanDisplay -lclanJPEG -lclanPNG -lclanSound -lclanVorbis + +############################################################################### + +# Fonction qui génère la liste des objets d'un répertoire +SOURCES=$(sort $(wildcard *.cpp)) +DEPENDS=$(patsubst %.cpp,%.d,$(SOURCES)) +OBJECTS=$(patsubst %.cpp,%.o,$(SOURCES)) + +# Archives (format .tar.gz abbrégé en .tgz) +ARCHIVE_SRC=../wormux-src-$(VERSION).tgz +ARCHIVE_BIN=../wormux-bin-$(VERSION).tgz + +# I18N +I18N_POT=../locale/new.pot +PO_FR=../locale/fr/LC_MESSAGES/wormux.pot +MO_FR=../locale/fr/LC_MESSAGES/wormux.mo +I18N_MO=$(MO_FR) + + +# Nom du programme (binaire) +ifdef LINUX + BIN:=../wormux +else + BIN:=../wormux.exe +endif + +DIR=/usr/ +DIR_OK=$(shell echo $(DIR) | sed -e 's!/$$!!')/ +DIR_BIN=$(DIR_OK)bin/ +DIR_SHARE=$(DIR_OK)share/games/wormux/ + +############################################################################### + +# Fichiers temporaires (à supprimer) +FICH_TMP_FIND = -name "*~" -o -name "*.~*" -o -name ".\#*" -o -name "*.d*" +FICH_TMP_FIND += -o -name "*.mo" + +# Fichiers inclus dans l'archive binaire (fichiers relatifs à ../) +INCLU_TGZ_BIN = $(notdir $(wildcard ../*.txt)) donnee/ doc/ $(notdir $(BIN)) + +# Fichiers inclus dans l'archive source (fichiers relatifs à ../) +INCLU_TGZ_SRC = $(notdir $(wildcard ../*.txt)) donnee/ doc/ +INCLU_TGZ_SRC+= $(addprefix src/,$(wildcard *.cpp *.h)) +INCLU_TGZ_SRC+= src/Makefile src/make.env + +# Fichiers exclus de l'archive sourcex +EXCLU_TGZ = --exclude='*~' --exclude='*.old' +EXCLU_TGZ += --exclude='*.o' --exclude='*.d' +EXCLU_TGZ += --exclude='*.\#*' --exclude='*.tgz' --exclude='*CVS' +EXCLU_TGZ_SRC=$(EXCLU_TGZ) --exclude 'wormux/wormux' +EXCLU_TGZ_BIN=$(EXCLU_TGZ) + +# On utilise des couleurs ? +ifeq ($(UTILISE_ESC),1) + # Met le texte 'en gras' + COUL_GRAS=\033[0;1m + + # Erreur + COUL_ERREUR=\033[1;33;41m + + # Attributs par défaut pour le texte + COUL_DEFAUT=\033[0m + + # Couleur de titre + COUL_SEPAR=\033[37;44m + + # Couleur de la commande à exécuter + COUL_EXEC=\033[1;31m +endif + +############################################################################### +# Fonctions + +# Met le texte 'en gras' +GRAS="$(COUL_GRAS)"$1"$(COUL_DEFAUT)" + +# Affiche un titre +TITRE=" ---[ $(COUL_GRAS)"$1"$(COUL_DEFAUT) ]---" + +# Taille d'un fichier (au format "humain" : 1 K, 2.4 M, etc.) +TAILLE_FICHIER=`ls -lh $1 | tr -s [:space:] | cut -f 5 -d ' '` + +# Ligne de séparation +SEPARATEUR="$(COUL_SEPAR)--- Wormux version $(VERSION) "$1" ---$(COUL_DEFAUT)" + +############################################################################### + +ifneq ($(word 2,2,$(MAKECMDGOALS)),) + ERREUR="\n"$(call TITRE,"ERREUR") "\n$(COUL_ERREUR)\n\ + !!!\n\ + !!! N'utilisez qu'une seule commande make à la fois s'il vous plait.\n\ + !!! Vous avez tapé \"make $(MAKECMDGOALS)\".\n\ + !!!$(COUL_DEFAUT)\n" +endif + +############################################################################### + +# Message d'erreur dans le cas où ClanLIB n'est pas présente +ERREUR_CLANLIB=$(call TITRE,"ERREUR") "$(COUL_ERREUR)\n\ + !!!\n\ + !!! Veuillez installer la librairie ClanLIB version 0.6, ainsi que le\n\ + !!! paquet de développement. Vous pouvez la trouver à l'adresse :\n\ + !!! http://www.clanlib.org/\n\ + !!!\n\ + !!! Sous Debian, passez en root (su), puis tapez :\n\ + !!! apt-get install libclanlib-dev\n\ + !!!$(COUL_DEFAUT)\n" + +ERREUR_LIBXMLPLUSPLUS=$(call TITRE,"ERREUR") "$(COUL_ERREUR)\n\ + !!!\n\ + !!! Veuillez installer la librairie libxml++ version 1.0, ainsi que le\n\ + !!! paquet de développement. Vous pouvez la trouver à l'adresse :\n\ + !!! http://libxmlplusplus.sourceforge.net/\n\ + !!!\n\ + !!! Sous Debian, passez en root (su), puis tapez :\n\ + !!! apt-get install libxml++1.0-dev\n\ + !!!$(COUL_DEFAUT)\n" + +WARNING_ROOT=\ +@if [ '$(shell id -u -n)' != 'root' ]; then\ + echo -e "$(COUL_ERREUR)\n !!!\n"\ + "!!! Assurez d'être root si vous voulez installer\n"\ + "!!! Wormux en dehors de votre répertoire HOME\n"\ + "!!!$(COUL_DEFAUT)\n";\ +fi diff -Naur wormux/src/make.env.rej wormux-new/src/make.env.rej --- wormux/src/make.env.rej 1969-12-31 19:00:00.000000000 -0500 +++ wormux-new/src/make.env.rej 2004-06-22 23:15:20.023347104 -0400 @@ -0,0 +1,34 @@ +*************** +*** 20,26 **** + # -g : Rajoute les informations de débogage (pour utiliser GDB) + # -ansi : Rejette le code non-ANSI + # -pedantic : Rejette le code non-ANSI, mais vraiment tout ! +- CXXFLAGS:=$(shell clanlib-config --cflags 2>/dev/null) + CXXFLAGS+=$(shell pkg-config libxml++-1.0 --cflags 2>/dev/null) + CXXFLAGS+=-Wall + ifdef RELEASE +--- 20,26 ---- + # -g : Rajoute les informations de débogage (pour utiliser GDB) + # -ansi : Rejette le code non-ANSI + # -pedantic : Rejette le code non-ANSI, mais vraiment tout ! ++ CXXFLAGS:= + CXXFLAGS+=$(shell pkg-config libxml++-1.0 --cflags 2>/dev/null) + CXXFLAGS+=-Wall + ifdef RELEASE +*************** +*** 37,43 **** + LINUX=1 + + # Librairies +- LIBS=$(shell clanlib-config --libs 2>/dev/null) + LIBS+=$(shell pkg-config libxml++-1.0 --libs 2>/dev/null) + LIBS+=-lclanDisplay -lclanJPEG -lclanPNG + +--- 37,43 ---- + LINUX=1 + + # Librairies ++ LIBS=-L/usr/lib/clanlib-0.6.5 -lclanCore -lclanApp + LIBS+=$(shell pkg-config libxml++-1.0 --libs 2>/dev/null) + LIBS+=-lclanDisplay -lclanJPEG -lclanPNG +