Building multimodule assemblies
I am trying to build a multimodule assembly. I have got 2 files namely Fraction.cs and MyCalc.cs and both in the same namespace and another AssemblyInfo.cs. I dont know how to make a makefile file so I copied one from the book I am following. Here are the contents
ASSEMBLY= MySharedAssembly.dll
BIN=.\bin
SRC=.
DEST=.\bin
C开发者_开发技巧SC=csc /nologo /debug+ /d:DEBUG /d:TRACE
MODULETARGET=/t:module
LIBTARGET=/t:library
EXETARGET=/t:exe
REFERENCES=System.dll
MODULES=$(DEST)\Fraction.dll $(DEST)\MyCalc.dll
METADATA=$(SRC)\Assemblyinfo.cs
all: $(DEST)\MySharedAssembly.dll
# Assembly metadata placed in the same module as manifest
$(DEST)\$(ASSEMBLY): $(METADATA) $(MODULES) $(DEST) $(CSC) $(LIBTARGET) /addmodule:$(MODULES: =;) /out:$@ %s
# Add MyCalc.dll module to this dependency list
$(DEST)\MyCalc.dll: MyCalc.cs $(DEST) $(CSC) $(MODULETARGET) /r:$(REFERENCES: =;) /out:$@ %s
# Add Fraction
$(DEST)\Fraction.dll: Fraction.cs $(DEST) $(CSC) $(MODULETARGET) /r:$(REFERENCES: =;) /out:$@ %s
$(DEST)::
!
if !EXISTS($(DEST))
mkdir $(DEST)
!endif
I understand the whole lot but am not familiar with the syntax. So when I am trying to run nmake I am getting the following error
makefile(21) : fatal error v1033: syntax error: ':' unexpected
I am assuming something is wrong in line 21. please help
$(DEST)::
Is this the faulty line?
It finally worked when I copy paseted the code from the Internet. The reason it worked is because the line that has error has been divided into two lines using the return key.
$(DEST)\$(ASSEMBLY): $(METADATA) $(MODULES) $(DEST) $(CSC) $(LIBTARGET) /addmodule:$(MODULES: =;) /out:$@ %s
精彩评论