#_TARGET_CULTURE=fr

# Current Build Version Number
TARGET_VERSION = 1.0.0.0

OUTPUT_DIR = release_$(_TARGET_CULTURE)

ASSEMBLY_NAME=LayoutTemplate

RESOURCE_LABEL_PREFIX=MapInfo.MiPro.Samples.LayoutTemplate

INPUT_RESOURCES = \
        $(OUTPUT_DIR)\Resources.$(_TARGET_CULTURE).resources

TARGET_LINKLIST = \
        /embed:$(OUTPUT_DIR)\Resources.$(_TARGET_CULTURE).resources,$(RESOURCE_LABEL_PREFIX).Properties.Resource.$(_TARGET_CULTURE).resources


#======== Build the assembly Resources DLL file=========
all: assembly

assembly: $(OUTPUT_DIR) $(OUTPUT_DIR)\$(ASSEMBLY_NAME).resources.dll 

$(OUTPUT_DIR):
        mkdir $(OUTPUT_DIR)

$(OUTPUT_DIR)\$(ASSEMBLY_NAME).resources.dll: $(INPUT_RESOURCES)
        echo $(TARGET_LINKLIST) > $(OUTPUT_DIR)\$(ASSEMBLY_NAME).rsp
        al /t:lib /c:$(_TARGET_CULTURE) /out:$(OUTPUT_DIR)\$(ASSEMBLY_NAME).resources.dll /v:$(TARGET_VERSION) @$(OUTPUT_DIR)\$(ASSEMBLY_NAME).rsp

$(OUTPUT_DIR)\Resources.$(_TARGET_CULTURE).resources: *.resx
        resgen $** $@

#=========== Clean ==========================
# REM remove .resource, .dll, files
clean:
    IF EXIST $(OUTPUT_DIR)\nul rmdir /S /Q $(OUTPUT_DIR)

