# ******************************************************************* # Makefile pour les modules de # /home/matawin/stochas/mylib/mcs # # ENVIRONNEMENT : SOLARIS 2.3 (Modula-2 Mcs) # # fichier ecrit par Luc De Bellefeuille, Benoit Martin # cette version : 25 Octobre 1995 # ******************************************************************* m = /home/matawin/stochas/mylib/mcs mcslib = /home/matawin/stochas/mcslib ## IMPORTANT : tcode doit exister pour que ce makefile soit efficace!!! ## Sinon, on doit utiliser les *.def deja existant et non les *.tex t = $m/tcode options = -cfg:c linker_options = -llib:$(mcslib)/clib.o:-lc \ -lnam:/usr/ucb/ld -cfg:c debug = -dbg optim = r = O = $(options) $(optim) L = $(linker_options) D = $(debug) LIB = -l:$(mcslib)/libmylib.a libmylib.a = $(mcslib)/libmylib.a clib.o = $m/clib.o mystr.lnk = $m/mystr.lnk myparam.lnk = $m/myparam.lnk myinout.lnk = $m/myinout.lnk chrono.lnk = $m/chrono.lnk num.lnk = $m/num.lnk clib.sym = $m/clib.sym mystr.sym = $m/mystr.sym myparam.sym = $m/myparam.sym myinout.sym = $m/myinout.sym chrono.sym = $m/chrono.sym num.sym = $m/num.sym clib.def = $m/clib.def mystr.def = $m/mystr.def myparam.def = $m/myparam.def myinout.def = $m/myinout.def chrono.def = $m/chrono.def num.def = $m/num.def modules = $(clib.o) $(num.sym) $(myinout.lnk) $(myparam.lnk)\ $(mystr.lnk) $(num.lnk) $(chrono.lnk) all: $(modules) message1 mylib_library message2 @ echo # ******************************************************************* # MODULES # ******************************************************************* clib: $(clib.o) $r clib.o: $(clib.o) $r clib.sym: $(clib.sym) $r clib.def: $(clib.def) $r $(clib.o): $m/clib.c $(clib.sym) cc -c -o $@ $m/clib.c $(clib.sym): $(clib.def) mc $(clib.def) $O -a:$m $(clib.def): $m/CLib.tex $t $m/CLib.tex $@ myinout: $(myinout.lnk) $r myinout.lnk: $(myinout.lnk) $r myinout.sym: $(myinout.sym) $r myinout.def: $(myinout.def) $r $(myinout.lnk): $m/myinout.mod $(myinout.sym) $(num.sym) mc $m/myinout.mod $O -a:$m $(myinout.sym): $(myinout.def) $(num.sym) mc $(myinout.def) $O -a:$m $(myinout.def): $m/MYINOUT.tex $t $m/MYINOUT.tex $@ myparam: $(myparam.lnk) $r myparam.lnk: $(myparam.lnk) $r myparam.sym: $(myparam.sym) $r myparam.def: $(myparam.def) $r $(myparam.lnk): $m/myparam.mod $(myparam.sym) $(myinout.sym) mc $m/myparam.mod $O -a:$m $(myparam.sym): $(myparam.def) mc $(myparam.def) $O -a:$m $(myparam.def): $m/MYPARAM.tex $t $m/MYPARAM.tex $@ mystr: $(mystr.lnk) $r mystr.lnk: $(mystr.lnk) $r mystr.sym: $(mystr.sym) $r mystr.def: $(mystr.def) $r $(mystr.lnk): $m/mystr.mod $(mystr.sym) $(myinout.sym) mc $m/mystr.mod $O -a:$m $(mystr.sym): $(mystr.def) mc $(mystr.def) $O -a:$m $(mystr.def): $m/MYSTR.tex $t $m/MYSTR.tex $@ num: $(num.lnk) $r num.lnk: $(num.lnk) $r num.sym: $(num.sym) $r num.def: $(num.def) $r $(num.lnk): $m/num.mod $(num.sym) $(myinout.sym) mc $m/conlr.def $O -a:$m mc $m/conlr.mod $O -a:$m mc $m/num.mod $O -a:$m $(num.sym): $(num.def) mc $(num.def) $O -a:$m $(num.def): $m/NUM.tex $t $m/NUM.tex $@ chrono: $(chrono.lnk) $r chrono.lnk: $(chrono.lnk) $r chrono.sym: $(chrono.sym) $r chrono.def: $(chrono.def) $r $(chrono.lnk): $m/chrono.mod $(chrono.sym) $(myinout.sym) \ $(num.sym) $(clib.sym) mc $m/chrono.mod $O -a:$m $(chrono.sym): $(chrono.def) mc $(chrono.def) $O -a:$m $(chrono.def): $m/CHRONO.tex $t $m/CHRONO.tex $@ # ******************************************************************* # messages # ******************************************************************* message1: @ echo @ echo "Tous les modules de mylib sont a jour." @ echo @ echo @ echo "Verification de la librairie libmylib.a ..." @ echo message2: @ echo @ echo "Pour compiler les programmes tests, c'est-a-dire" @ echo " testchrono, testheure ou testnum ..." @ echo @ echo "faire:" @ echo ' make ' @ echo @ echo 'ou encore (pour les avoir tous en une seule commande)' @ echo @ echo ' make tests' @ echo # ******************************************************************* # MYLIB_LIBRARY # ******************************************************************* mylib_library: verif_mess $(libmylib.a) @ echo @ echo "La librairie est a jour." @ echo @ echo "Pour l'utiliser, il faut fournir a la commande" @ echo "de compilation les options:" @ echo @ echo " $(LIB)" @ echo " $(linker_options)" @ echo $(libmylib.a): $(myinout.sym) $(myinout.lnk) $(clib.sym) $(clib.o) \ $(num.sym) $(num.lnk) $(myparam.sym) $(myparam.lnk) \ $(mystr.sym) $(mystr.lnk) $(chrono.sym) $(chrono.lnk) \ $m/conlr.sym $m/conlr.lnk @ echo @ echo "La librairie n'est pas a jour ou n'existe pas." @ echo "Generation de la nouvelle librairie ..." @ echo @ rm -f $@ @ mar -c:$@ $(myinout.sym) $(myinout.lnk) $(clib.sym) \ $(num.sym) $(num.lnk) $(myparam.sym) $(myparam.lnk) \ $(mystr.sym) $(mystr.lnk) $(chrono.sym) $(chrono.lnk) $(clib.o) \ $m/conlr.sym $m/conlr.lnk @ echo @ echo "TERMINE !" @ echo @ echo "Contenu de la librairie:" @ echo "========================" @ mar -s:$@ @ echo verif_mess: @ echo @ echo "Verification des fichiers constituant la librairie ..." @ echo # ******************************************************************* # EXEMPLES # ******************************************************************* tests: $m/testchrono $m/testheure $m/testnum @ echo ls -l test* @ echo testchrono: $m/testchrono $r testchrono.lnk: $m/testchrono.lnk $r $m/testchrono: $m/testchrono.lnk $(libmylib.a) ml $@ $L $(LIB) $m/testchrono.lnk: $m/testchrono.mod $(libmylib.a) mc $m/testchrono.mod $O $(LIB) testheure: $m/testheure $r testheure.lnk: $m/testheure.lnk $r $m/testheure: $m/testheure.lnk $(libmylib.a) ml $@ $L $(LIB) $m/testheure.lnk: $m/testheure.mod $(libmylib.a) mc $m/testheure.mod $O $(LIB) testnum: $m/testnum $r testnum.lnk: $m/testnum.lnk $r $m/testnum: $m/testnum.lnk $(libmylib.a) ml $@ $L $(LIB) $m/testnum.lnk: $m/testnum.mod $(libmylib.a) mc $m/testnum.mod $O $(LIB) # ********** ********** **********FIN********** ********** **********