Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
user:zeman:mdmake [2010/11/05 15:11] zeman |
user:zeman:mdmake [2010/11/05 15:28] zeman |
||
---|---|---|---|
Line 6: | Line 6: | ||
An older, more detailed discussion of the related problems is described [[rizeni-pokusu-pomoci-makefilu|here]] but it's in Czech. | An older, more detailed discussion of the related problems is described [[rizeni-pokusu-pomoci-makefilu|here]] but it's in Czech. | ||
+ | |||
+ | ===== Makefile ===== | ||
+ | |||
+ | * A MD-makefile ('' | ||
+ | * Enumerate variables that contain values of respective dimensions. At the same time tell how to combine them into file names (paths). (The spaces will be deleted, their purpose here is to show what delimiter should be omitted if a dimension is omitted. Permitted delimiters are slash, hyphen and period.) | ||
+ | < | ||
+ | * The delimiters are not mandatory but MD-make checks whether missing delimiters do not cause ambiguities (e.g. if LANGUAGES = hi him, DOMAINS = mix ix, then .MDIMS: LANGUAGES DOMAINS would cause problems). | ||
+ | * The last dimension in the list of dimensions is special. It need not be named STATES and it need not be delimited by a period (although it is recommended - in some operating systems it is desirable that the file name extension defines the type of the contents), nevertheless the value of this dimension is considered the type of the file. Among others, the file type defines, in what dimensions the files of this type exist. MD-make gets that information from the rule that generates files of this type as its goal. For every type there must be at least one such rule. Theoretically there can be more if e.g. we want to perform different actions for different languages. In that case all such rules must lead to the same list of dimensions of the goal. However, they are not required to cover together all values of all these dimensions. | ||
+ | * The respective variables with values of the respective dimensions must be normal variables containing only a list of words separated by spaces. MD-make will not search them for references to other variables or macros. If it encounters a dollar sign in these variables, it will throw an exception and terminate. These variables will be visible in the generated makefile as well. | ||
+ | * No value in no dimension can be identical with any other value of any dimension. In other words, a value uniquely identifies its dimension. (This helps prevent ambiguities in file names that do not contain all dimensions.) | ||
+ | * There are special keywords to mark a multidimensional pattern rule. The following parameters can be supplied, too: | ||
+ | * In what dimensions the target file exists. (The other dimensions will not appear in the file name.) | ||
+ | * What are the constraints for the values in the respective dimensions. (Standard way is the '' | ||
+ | * MD-make will generate many normal rules from the multidimensional rule. In these generated rules, all combinations of all values in all affected dimensions will appear. As these rules are not templatic any more, we don't have to fear that gnu make will encounter cyclic dependencies or other problems. | ||
+ | |||
+ | * Uvnitř příkazů lze použít nové proměnné '' | ||
+ | * MD pravidlo končí povinně prázdným řádkem (dokonce i na konci souboru). | ||
+ | * Není-li uveden parametr '' | ||
+ | * Parametr '' | ||
+ | * Jestliže '' | ||
+ | * Jestliže '' | ||
+ | * Jestliže některý zdrojový soubor vyžaduje rozměr, který cílový soubor neobsahuje, a tento rozměr není zafixován, pravidlo se rozgeneruje i pro všechny hodnoty tohoto rozměru. Bude pak existovat několik konkurenčních pravidel, která vytvářejí tentýž cílový soubor. | ||
+ | * '' | ||
+ | * '' | ||
+ | * Odkaz na hodnotu rozměru z& | ||
+ | |||
+ | < | ||
+ | .md.rul mst.conll < blind.conll mst | ||
+ | .md.dep $(TOOLDIR)/ | ||
+ | .md.for: LANGUAGES DE PREPROCESSINGS | ||
+ | .md.fix: test | ||
+ | @echo Running MST for language $(*LANGUAGES): | ||
+ | $(TOOLDIR)/ | ||
+ | |||
+ | * Je možné definovat vstupní soubory. Ty typicky leží úplně v& | ||
+ | * Vygenerovaný makefile by navíc mohl obsahovat pro každou hodnotu každého rozměru seznam souborů, v& | ||
+ | * V& | ||
+ | |||
+ | < | ||
+ | |||
+ | se přepíše jako | ||
+ | |||
+ | < | ||
+ | all_d_hi_conll: |