[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
user:zeman:mdmake [2010/11/05 15:28]
zeman
user:zeman:mdmake [2010/11/05 15:47]
zeman
Line 20: Line 20:
     * What are the constraints for the values in the respective dimensions. (Standard way is the ''.md.if'' directive but we would like to be able to constrain the ''.STATES'' dimension (or the last dimension in the list) directly in the rule.     * What are the constraints for the values in the respective dimensions. (Standard way is the ''.md.if'' directive but we would like to be able to constrain the ''.STATES'' dimension (or the last dimension in the list) directly in the rule.
     * 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.     * 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.
 +    * New variables ''$(*1)'' (or other number instead of 1, for n-th dependency) are available within the commands in the rule. MD-make finds the rule that creates this dependency, uses it to determine the set of dimensions of the dependency, constructs the name of the file and replaces the variable by the file name. MD-make leaves intact ''$<'' and ''$^'' that will still work in the generated makefile. However, don't use ''$*'' that does not make sense in MD-rules (unlike in normal pattern rules).
 +    * A MD-rule ends obligatorily with an empty line (even at the end of the file).
 +    * If there is no parameter ''.md.for'' the rule is generated for all known dimensions except the last one (''STATES'' in our case).
 +    * The ''.md.fix'' parameter contains values that are fixed in this rule, i.e. the rule is not generated for other values of the same dimension. So far it is not allowed to include more values in one dimension (although in theory we may want to use it to constrain partial generation).
 +    * If ''.md.fix'' contains a dimension that at the same time appears in ''.md.for'', it means that the target type exists in this dimension, has its value in its name/path but this particular rule generates this file only for one value of that dimension.
 +    * If ''.md.fix'' contains a dimension that does not appear in ''.md.for'', it means that the target file type does not know this dimension and does not have it in its name/path but one of the source files knows the dimension and needs to know what value ve have on mind. We can figure out from the rules generating the source files what dimensions they exist in.
 +    * If a source file requires a dimension not contained in the target file, and the dimension is not fixed, the rule will be generated for all values of this dimension. This means that there will be several competing rules for the same target file.
 +    * ''.md.del'' removes dimensions from ''.md.for'' (handy if ''.md.for'' is not explicitly stated and contains all dimensions by default)
 +    * ''.md.fxd'' combines ''.md.fix'' and ''.md.del''. Contains values, not dimensions (like ''.md.fix'' and unlike ''.md.del'')
 +    * If a command in a rule refers a dimension (e.g. ''$(*LANGUAGES)'') the reference will be converted to the actual value of the dimension. If different source files have different values of the same dimension within one generated rule the reference will be replaced by the value that the target file takes in this dimension (i.e. by the variable value). Anyway the purpose of such references is to refer to the variable dimensions. Modified values of particular source files are fixed exceptions, we know them in advance and can write them to the command directly, if necessary.
  
-    * Uvnitř příkazů lze použít nové proměnné ''$(*1)'', resp. místo jedničky jiné číslo, pro n-tou závislost. MD-make si najde pravidlo, kterým tato závislost vzniká, zjistí si z&nbsp;něj, v&nbsp;jakých rozměrech se pohybuje, a podle toho zkonstruuje jméno příslušného souboru, které na dané místo vloží. Beze změny ponechá ''$<'' a ''$^'', které budou fungovat samy od sebe, avšak pozor na ''$*'', které v&nbsp;MD pravidlech (na rozdíl od obyčejných šablonovitých pravidel) nemá smysl. 
-    * MD pravidlo končí povinně prázdným řádkem (dokonce i na konci souboru). 
-    * Není-li uveden parametr ''.md.for'', pravidlo se rozgeneruje pro všechny známé rozměry kromě posledního (u nás ''STATES'', ale může se jmenovat i jinak). 
-    * Parametr ''.md.fix'' obsahuje hodnoty, které jsou v&nbsp;tomto pravidle pevné, tj. pravidlo se nerozgenerovává pro ostatní hodnoty téhož rozměru. Není zatím dovoleno uvést více hodnot ve stejném rozměru (i když by to teoreticky mohlo sloužit k&nbsp;vymezení částečného rozgenerování). 
-      * Jestliže ''.md.fix'' obsahuje rozměr, který je současně uveden v&nbsp;''.md.for'', znamená to, že cílový typ souboru se pohybuje v&nbsp;tomto rozměru, má jeho hodnotu uvedenou v&nbsp;cestě, akorát toto konkrétní pravidlo generuje tento soubor pouze pro jednu hodnotu v&nbsp;dotyčném rozměru. 
-      * Jestliže ''.md.fix'' obsahuje rozměr, který není současně uveden v&nbsp;''.md.for'', znamená to, že cílový typ souboru tento rozměr nezná a nemá ho uveden v&nbsp;cestě, avšak některý ze zdrojových souborů tento rozměr má a potřebuje vědět, kterou hodnotu máme na mysli. Které ze zdrojových souborů hodnotu ''.md.fix'' využijí, poznáme z&nbsp;pravidel, která tyto soubory generují jako cílové a vymezují jejich rozměry. 
-      * 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. 
-    * ''.md.del'' odstraní rozměry z&nbsp;''.md.for'' (nejvíce se hodí, když ''.md.for'' není uvedeno a defaultně tedy obsahuje všechny rozměry) 
-    * ''.md.fxd'' je jako ''.md.fix'' a ''.md.del'' dohromady. Uvádějí se hodnoty, nikoli názvy rozměrů (tedy jako u ''.md.fix'' a na rozdíl od ''.md.del'') 
-    * Odkaz na hodnotu rozměru z&nbsp;příkazu (např. ''$(*LANGUAGES)'') se převede na aktuální hodnotu daného rozměru. Pokud mohou mít různé zdrojové soubory různé hodnoty téhož rozměru v&nbsp;rámci jednoho vygenerovaného pravidla, odkaz se převede na hodnotu, které v&nbsp;tomto rozměru nabývá cílový soubor, resp. která je proměnná. Odkazy tohoto druhu byly stejně zavedeny kvůli proměnným rozměrům. Odlišné hodnoty u konkrétních zdrojových souborů jsou fixní výjimky, tyto hodnoty známe předem a v&nbsp;případě potřeby je můžeme do příkazu zapsat přímo. 
  
 <code>.MDRULE <code>.MDRULE

[ Back to the navigation ] [ Back to the content ]