Skip to content

Commit 0c2f149

Browse files
committed
feat(make): unified make based build system
Added all prerequisite programs in binary for easier use. Make is now implemented top-level, and is not expected to do too much work actually. It will, however, keep track of all required gsl invocation and make sure calls are efficient by not having to rebuild everything every time. That's what make does, anyway ;)
1 parent f13c296 commit 0c2f149

7 files changed

Lines changed: 83 additions & 20 deletions

File tree

Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.PHONY: json-to-xml clean help api-deps
2+
3+
include Makefile.helpers
4+
5+
PYTHON = python2.7
6+
CONVERT = $(PYTHON) ./etc/bin/json2xml.py
7+
GSL = ./etc/bin/gsl_$(OS)-$(ARCH)
8+
9+
API_DEPS = .api.deps
10+
API_JSON_FILES = $(shell find ./etc -type f -name '*-api.json')
11+
API_XML_FILES = $(patsubst %.json,%.xml,$(API_JSON_FILES))
12+
13+
help:
14+
$(info Programs)
15+
$(info ----> GSL: '$(GSL)')
16+
$(info ----> json2xml: '$(CONVERT)')
17+
$(info )
18+
$(info Targets)
19+
$(info help - print this help)
20+
$(info json-to-xml - convert json API files to xml for consumption by GSL)
21+
$(info api-deps - generate a file to tell make what API file dependencies will be)
22+
23+
json-to-xml: $(API_XML_FILES)
24+
25+
%.xml: %.json
26+
$(CONVERT) --pretty -o $@ < $<
27+
28+
clean:
29+
-rm $(API_XML_FILES)
30+
31+

Makefile.helpers

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
OS := $(shell uname)
2+
ifeq ($(OS), "")
3+
OS = Windows
4+
endif
5+
6+
ARCH :=
7+
8+
# based on http://stackoverflow.com/questions/714100/os-detecting-makefile
9+
ifeq ($(OS),Windows)
10+
ARCH = WIN32
11+
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
12+
ARCH = AMD64
13+
endif
14+
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
15+
ARCH = IA32
16+
endif
17+
else
18+
UNAME_S := $(shell uname -s)
19+
ifeq ($(UNAME_S),Linux)
20+
OS = LINUX
21+
endif
22+
ifeq ($(UNAME_S),Darwin)
23+
OS = OSX
24+
endif
25+
UNAME_M := $(shell uname -m)
26+
ifeq ($(UNAME_M),x86_64)
27+
ARCH = AMD64
28+
endif
29+
ifneq ($(filter %86,$(UNAME_M)),)
30+
ARCH = IA32
31+
endif
32+
ifneq ($(filter arm%,$(UNAME_M)),)
33+
ARCH = ARM
34+
endif
35+
endif

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,20 @@ which require the token to be refreshed.
1414
You will need authorization to perform most of the operations implemented here - it can be obtained
1515
and handled using the [yup-oauth2 library][oauth].
1616

17-
[oauth]: [https://crates.io/crates/yup-oauth2]
17+
18+
# License
19+
20+
The license of everything not explicitly under a different license are licensed as specified in `LICENSE.md`.
21+
22+
What follows is a list of other material that is licensed differently.
23+
24+
* **./etc/bin/json2xml.py** is licensed like MIT, as shown in the header of the file. See original source [on github][html2json].
25+
* **./etc/bin/gsl_\*** is licensed under [GNU GPL][imatix-copying]. The source code is [on github][gsl]
26+
* **./etc/api/\*\*/*.json** are licensed under a [MIT-like google license][google-lic]
27+
28+
29+
[oauth]: https://crates.io/crates/yup-oauth2
30+
[html2json]: https://github.com/hay/xml2json
31+
[imatix-copying]: https://github.com/imatix/gsl/blob/master/COPYING
32+
[gsl]: https://github.com/imatix/gsl
33+
[google-lic]: https://github.com/google/google-api-go-client/blob/master/LICENSE

etc/Makefile

Lines changed: 0 additions & 19 deletions
This file was deleted.

etc/bin/gsl_LINUX-AMD64

661 KB
Binary file not shown.

etc/bin/gsl_OSX-AMD64

588 KB
Binary file not shown.
File renamed without changes.

0 commit comments

Comments
 (0)