Hey. I'm trying to compile some C# scripts into a .net dll, but I'm completely green to makefile writing - been sheltered too much by IDEs. This is my best attempt at a file so far: Code (csharp): SRCS=Sources/*.cs LIBS=/Applications/Unity/Unity.app/Contents/Frameworks/UnityEngine.dll OUT=Path.dll Path.dll: $(SRCS) gmcs -r:$(LIBS) -target:library -out:$(OUT) $(SRCS) all: Path.dll When run I get the following error: Code (csharp): Makefile:6: *** multiple target patterns. Stop. I'm drawing a blank on what may have caused the problem and how to solve it. Help please :cry:
This works for me: Code (csharp): SRCS=Sources/*.cs LIBS=/Applications/Unity/Unity.app/Contents/Frameworks/UnityEngine.dll OUT=Path.dll Path: gmcs -r:$(LIBS) -target:library -out:$(OUT) $(SRCS) all: Path It seems that make requires that you use a tab before 'gmcs'. Spaces aren't sufficient. I'm not sure if the other changes I made were necessary, since, as I said on IRC, I only learnt enough about make to solve my particular problem. You might still want to read the documentation so that you understand what's really happening.
NAnt (http://nant.sourceforge.net/) is a nice .NET-centric build tool. It was developed specifically to get around the nuisances of using makefiles.
Thanks for the link andeee. Packaged the makefile and a shell scrip inside a nice double-click-me app bundle though so I'm quite happy