Back to Nutria ¦ Start Page

Convert Multiple SDC Via gmake Simplified

Makefile


 
    InputDir=C:/Users/$(USERNAME)/AirborneHydroMapping/HydroVish/data/SampleData/FWF
    OutputFolder=$(InputDir)

    gridname=TestData

    # Defining a result that depends on two rules - this allows for parallelization via make -j !
    # This is the only place where the filenames need to be specified!
    Result: $(subst .sdc,.f5,$(notdir $(wildcard $(InputDir)/*.sdc)))


    # Define a gmake function to encode paths in URL format
    encode=$(subst :,%3A,$(subst /,%2F,$(1)))

    # Calling the gmake function for string encoding
    OutputFolder.enc=$(call encode,$(OutputFolder))

    export REQUEST_METHOD=GET

    # Pattern Rules to convert each SDC file, setting the QUERY_STRING environment variable as part of the rule
    %.f5: $(InputDir)/%.sdc
      QUERY_STRING="InputFiles=$(call encode,$<)&Nutrition%3A%3Agridname=$(gridname)&Output+Folder=$(OutputFolder.enc)&Nutrition=SDC+to+F5&Action=Process" \
      InputDir=C:/Users/$(USERNAME)/AirborneHydroMapping/HydroVish/bin/win64/HydroVish.exe

    clean:
      $(RM) *.f5
    


Start Page