Makefile
HydroVish.exe=C:/Users/$(USERNAME)/AirborneHydroMapping/HydroVish/bin/win64/HydroVish.exe
InputDir=C:/Users/$(USERNAME)/AirborneHydroMapping/HydroVish/data/SampleData/FWF
OutputFolder=$(abspath $(dir $(firstword $(MAKEFILE_LIST))))
gridname=TestData
# Generate the list of output files from all .txt files in the input directory.
# The only parameter to specify is the InputDir and the (optional) gridname
#
Result: $(subst .txt,.f5,$(notdir $(wildcard $(InputDir)/*_Traj_*.txt)))
# 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 TXT file, setting the QUERY_STRING environment variable as part of the rule
#
%.f5: $(InputDir)/%.txt
QUERY_STRING="InputFiles=$(call encode,$<)&Nutrition%3A%3ADelimiter=space&Nutrition%3A%3AGridName=AsciiToF5&Nutrition%3A%3AHeaderLines=0&Nutrition%3A%3AParsing=Positions%3Apoint%3A1%2B2%2B3%2CGPSTime%3Adouble%3A0%2CRoll%3Adouble%3A4%2CPitch%3Adouble%3A5%2CYaw%3Adouble%3A6&Nutrition%3A%3AProject+Start+Date%5BDay.Month.Year%5D=01.01.2000&Nutrition%3A%3ATime+as+UTC=false&Output+Folder=$(OutputFolder.enc)&Nutrition=ASCII+to+F5&Action=Process" \
$(HydroVish.exe)
clean:
$(RM) *.f5