Skip to content

Commit 8b1bc70

Browse files
committed
Added make.bat file generation to Makefile
1 parent 6e28961 commit 8b1bc70

File tree

2 files changed

+55
-33
lines changed

2 files changed

+55
-33
lines changed

Makefile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,28 @@ distribute_docs:
126126
@cp -vR docs dist/
127127
@cp -vR how-to dist/
128128

129-
release: distribute_docs dist/linux-amd64 dist/macos-amd64 dist/macos-arm64 dist/windows-amd64 dist/raspbian-arm7
129+
gen_batfiles: .FORCE
130+
@echo '@echo off' >make.bat
131+
@echo 'REM This is a Windows 10 Batch file for building dataset command' >>make.bat
132+
@echo 'REM from the command prompt.' >>make.bat
133+
@echo 'REM' >>make.bat
134+
@echo 'REM It requires: go version 1.16.6 or better and the cli for git installed' >>make.bat
135+
@echo 'REM' >>make.bat
136+
@echo 'go version' >>make.bat
137+
@echo 'mkdir bin' >>make.bat
138+
@echo 'echo "Getting ready to build the datatools in bin"' >>make.bat
139+
@for FNAME in $(PROGRAMS); do echo "go build -o bin/$${FNAME}.exe cmd/$${FNAME}/$${FNAME}.exe" | sed -E 's/\//\\/g' >> make.bat; done
140+
@echo 'echo "Checking compile should see version number of dataset"' >>make.bat
141+
@for FNAME in $(PROGRAMS); do echo "bin/$${FNAME}.exe -version" | sed -E 's/\//\\/g' >> make.bat; done
142+
@echo 'echo "If OK, you can now copy the dataset.exe to %USERPROFILE%\go\bin"' >>make.bat
143+
@echo 'echo ""' >>make.bat
144+
@echo 'echo " copy bin/* %USERPROFILE%/AppData/go/bin"' | sed -E 's/\//\\/g' >>make.bat
145+
@echo '""' >>make.bat
146+
@echo 'echo "or someplace else in your %PATH%"' >>make.bat
147+
@echo '""' >>make.bat
148+
@git add make.bat
149+
150+
release: build gen_batfiles distribute_docs dist/linux-amd64 dist/macos-amd64 dist/macos-arm64 dist/windows-amd64 dist/raspbian-arm7
130151

131152

132153
.FORCE:

make.bat

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,38 @@
22
REM This is a Windows 10 Batch file for building dataset command
33
REM from the command prompt.
44
REM
5-
REM It requires: go version 1.12.4 or better and the cli for git installed
5+
REM It requires: go version 1.16.6 or better and the cli for git installed
66
REM
77
go version
88
mkdir bin
99
echo "Getting ready to build the datatools in bin"
10-
go build -o bin\codemeta2cff.exe cmd\codemeta2cff\codemeta2cff.go
11-
go build -o bin\csv2json.exe cmd\csv2json\*.go
12-
go build -o bin\csv2mdtable.exe cmd\csv2mdtable\*.go
13-
go build -o bin\csv2xlsx.exe cmd\csv2xlsx\*.go
14-
go build -o bin\csvcleaner.exe cmd\csvcleaner\*.go
15-
go build -o bin\csvcols.exe cmd\csvcols\*.go
16-
go build -o bin\csvfind.exe cmd\csvfind\*.go
17-
go build -o bin\csvjoin.exe cmd\csvjoin\*.go
18-
go build -o bin\csvrows.exe cmd\csvrows\*.go
19-
go build -o bin\finddir.exe cmd\finddir\*.go
20-
go build -o bin\findfile.exe cmd\findfile\*.go
21-
go build -o bin\json2toml.exe cmd\json2toml\*.go
22-
go build -o bin\json2yaml.exe cmd\json2yaml\*.go
23-
go build -o bin\jsoncols.exe cmd\jsoncols\*.go
24-
go build -o bin\jsonjoin.exe cmd\jsonjoin\*.go
25-
go build -o bin\jsonmunge.exe cmd\jsonmunge\*.go
26-
go build -o bin\jsonrange.exe cmd\jsonrange\*.go
27-
go build -o bin\mergepath.exe cmd\mergepath\*.go
28-
go build -o bin\range.exe cmd\range\*.go
29-
go build -o bin\reldate.exe cmd\reldate\*.go
30-
go build -o bin\string.exe cmd\string\*.go
31-
go build -o bin\timefmt.exe cmd\timefmt\*.go
32-
go build -o bin\toml2json.exe cmd\toml2json\*.go
33-
go build -o bin\urlparse.exe cmd\urlparse\*.go
34-
go build -o bin\xlsx2csv.exe cmd\xlsx2csv\*.go
35-
go build -o bin\xlsx2json.exe cmd\xlsxjson\*.go
36-
go build -o bin\yaml2json.exe cmd\yaml2json\*.go
37-
10+
go build -o bin\codemeta2cff.exe cmd\codemeta2cff\codemeta2cff.exe
11+
go build -o bin\csv2json.exe cmd\csv2json\csv2json.exe
12+
go build -o bin\csv2mdtable.exe cmd\csv2mdtable\csv2mdtable.exe
13+
go build -o bin\csv2xlsx.exe cmd\csv2xlsx\csv2xlsx.exe
14+
go build -o bin\csvcleaner.exe cmd\csvcleaner\csvcleaner.exe
15+
go build -o bin\csvcols.exe cmd\csvcols\csvcols.exe
16+
go build -o bin\csvfind.exe cmd\csvfind\csvfind.exe
17+
go build -o bin\csvjoin.exe cmd\csvjoin\csvjoin.exe
18+
go build -o bin\csvrows.exe cmd\csvrows\csvrows.exe
19+
go build -o bin\finddir.exe cmd\finddir\finddir.exe
20+
go build -o bin\findfile.exe cmd\findfile\findfile.exe
21+
go build -o bin\json2toml.exe cmd\json2toml\json2toml.exe
22+
go build -o bin\json2yaml.exe cmd\json2yaml\json2yaml.exe
23+
go build -o bin\jsoncols.exe cmd\jsoncols\jsoncols.exe
24+
go build -o bin\jsonjoin.exe cmd\jsonjoin\jsonjoin.exe
25+
go build -o bin\jsonmunge.exe cmd\jsonmunge\jsonmunge.exe
26+
go build -o bin\jsonrange.exe cmd\jsonrange\jsonrange.exe
27+
go build -o bin\mergepath.exe cmd\mergepath\mergepath.exe
28+
go build -o bin\range.exe cmd\range\range.exe
29+
go build -o bin\reldate.exe cmd\reldate\reldate.exe
30+
go build -o bin\string.exe cmd\string\string.exe
31+
go build -o bin\timefmt.exe cmd\timefmt\timefmt.exe
32+
go build -o bin\toml2json.exe cmd\toml2json\toml2json.exe
33+
go build -o bin\urlparse.exe cmd\urlparse\urlparse.exe
34+
go build -o bin\xlsx2csv.exe cmd\xlsx2csv\xlsx2csv.exe
35+
go build -o bin\xlsx2json.exe cmd\xlsx2json\xlsx2json.exe
36+
go build -o bin\yaml2json.exe cmd\yaml2json\yaml2json.exe
3837
echo "Checking compile should see version number of dataset"
3938
bin\codemeta2cff.exe -version
4039
bin\csv2json.exe -version
@@ -63,7 +62,9 @@ bin\urlparse.exe -version
6362
bin\xlsx2csv.exe -version
6463
bin\xlsx2json.exe -version
6564
bin\yaml2json.exe -version
66-
echo "If OK, you can now copy the dataset.exe to %USERPROFILE%\go\bin"
67-
echo ""
68-
echo " copy bin\* %USERPROFILE%\go\bin
65+
echo "If OK, you can now copy the dataset.exe to %USERPROFILE%\goin"
6966
echo ""
67+
echo " copy bin\* %USERPROFILE%\AppData\go\bin"
68+
""
69+
echo "or someplace else in your %PATH%"
70+
""

0 commit comments

Comments
 (0)