-CORE_SRC = MSymbol.cs MPlist.cs MText.cs
CS=gmcs
-all: M17N.exe temp.exe
+M17N_SRC = M17N.cs
+CORE_SRC = MSymbol.cs MPlist.cs MCharTable.cs MText.cs MDatabase.cs
+EXPR_SRC = MExpression.cs
+INPUT_SRC = MInputMethod.cs
+DLL = M17N.dll M17NCore.dll M17NExpr.dll M17NIM.dll
+EXAMPLE = symbol.exe plist.exe chartab.exe text.exe textprop.exe database.exe \
+ expr.exe
+TEST = rearsticky.exe frontsticky.exe bothsticky.exe \
+ sensitive.exe frontsensitive.exe rearsensitive.exe
-M17NCore.dll: ${CORE_SRC}
- $(CS) /out:$@ /t:library ${CORE_SRC}
+DEBUG_FLAG =
-M17N.exe: M17N.cs M17NCore.dll
- $(CS) /r:M17NCore M17N.cs
+all: ${DLL} ${EXAMPLE} ${TEST}
-temp.exe: temp.cs M17NCore.dll
- $(CS) -codepage:65001 /r:M17NCore temp.cs
+M17N.dll: ${M17N_SRC}
+ $(CS) $(DEBUG_FLAG) -out:$@ -t:library ${M17N_SRC}
+
+M17NCore.dll: M17N.dll ${CORE_SRC}
+ $(CS) $(DEBUG_FLAG) -out:$@ -t:library -r:M17N.dll ${CORE_SRC}
+
+M17NExpr.dll: M17N.dll M17NCore.dll ${EXPR_SRC}
+ $(CS) $(DEBUG_FLAG) -out:$@ -t:library -r:M17N.dll -r:M17NCore.dll ${EXPR_SRC}
+
+M17NIM.dll: M17N.dll M17NCore.dll M17NExpr.dll ${INPUT_SRC}
+ $(CS) $(DEBUG_FLAG) -out:$@ -t:library -r:M17N.dll -r:M17NCore.dll -r:M17NExpr.dll ${INPUT_SRC}
+
+input.exe: %.cs
+ $(CS) $(DEBUG_FLAG) -codepage:65001 -r:M17N.dll -r:M17NCore -r:M17NExpr -r:M17NIM.dll $<
+
+%.exe: %.cs
+ $(CS) $(DEBUG_FLAG) -codepage:65001 -r:M17N.dll -r:M17NCore $<
clean:
rm -f *.dll *.exe
+
+temp.exe: temp.cs
+ $(CS) temp.cs