1
# gnsdk C# wrapper sample makefile
##

CC=Csc.exe
CP=cp

GNSDK_LIB_PATH=../../../../lib/$(GNSDK_PLATFORM)
GNSDK_WRAPPER_LIB_PATH=../../lib/$(GNSDK_PLATFORM)
GNSDK_MARSHAL_LIB=$(GNSDK_WRAPPER_LIB_PATH)/gnsdk_csharp_marshal.dll
GNSDK_CSHARP_LIB=../../lib/gnsdk_csharp.dll


CSHARP_FLAGS=/noconfig /nowarn:1701,1702 /nostdlib+ /errorendlocation
CSHARP_REFS=/reference:$(GNSDK_CSHARP_LIB) /reference:"Microsoft.CSharp.dll" /reference:"mscorlib.dll" /reference:"System.Core.dll" /reference:"System.Data.DataSetExtensions.dll" /reference:"System.Data.dll" /reference:"System.dll" /reference:"System.Xml.dll" 

ifeq ($(GNSDK_PLATFORM), win_x86-32)
    CSHARP_FLAGS+=/platform:x86
endif

ifeq ($(GNSDK_PLATFORM), win_x86-64)
    CSHARP_FLAGS+=/platform:x64
endif

SAMPLE_TARGET=sample.exe


build_sample:
    $(CC) $(CSHARP_FLAGS) $(CSHARP_REFS) /out:$(SAMPLE_TARGET) /target:exe /utf8output MusicIDStream.cs
    $(CP) $(GNSDK_MARSHAL_LIB) .
    $(CP) $(GNSDK_CSHARP_LIB) .

I got a makefile for a c# application. I am trying to run it from visual studio command prompt. I got error with this row: CSHARP_FLAGS+=/platform:x86

  • 1
    are you doing it from `visual studio command prompt` or the `ms build command prompt` – MethodMan Jul 19 '16 at 19:18
  • I am doing with visual studio command prompt. –  Jul 19 '16 at 19:23
  • well I wonder if they produce and or expect different params as far as formatting and interpretation since I see `build_sample` I figured you be wanting to use the ms build command prompt.. but I could be mistaken also – MethodMan Jul 19 '16 at 19:25

2 Answers2

4

The makefile you are looking at appears to be a GNU make makefile. You cannot use it with nmake. You'll have to install GNU make if you want to use this makefile, or else write an nmake makefile to use with nmake.

MadScientist
  • 92,819
  • 9
  • 109
  • 136
0

The separator missing refers to the fact that nmake is missing a colon between a target and its dependents.

In this case this is caused by the use of the GNU make ifeq, which NMAKE doesn't recognize and interprets as a target. Use the if-clause of NMAKE.

So replace your if-clauses with the following:

!if "$(GNSDK_PLATFORM)" == "win_x86-32"
CSHARP_FLAGS+=/platform:x86
!endif

!if "$(GNSDK_PLATFORM)" == "win_x86-64"
CSHARP_FLAGS+=/platform:x64
!endif

Note the ! mark before the if and endif clause and also the lack of additional line spaces. These are important.

D.J. Klomp
  • 2,429
  • 1
  • 15
  • 30