File: Makefile

package info (click to toggle)
go-gir-generator 2.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,216 kB
  • sloc: ansic: 186; makefile: 44
file content (54 lines) | stat: -rw-r--r-- 1,520 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
PREFIX = /usr
GOBUILD = go build
GOTEST = go build
GORUN = go run
OUT_GIR_DIR = out/src/pkg.deepin.io/gir/

all: build

CURRENT_DIR = $(shell pwd)
export GOPATH = $(CURDIR):$(CURDIR)/out

GENERATOR = out/gir-generator

build: glib-2.0 gobject-2.0 gio-2.0 gudev-1.0 copyfile 

generator:
	mkdir -p $(OUT_GIR_DIR)
	cd src/gir-generator && ${GOBUILD}  -o $(CURRENT_DIR)/${GENERATOR}

copyfile:
	cp -r  lib.in/gobject-2.0   $(OUT_GIR_DIR)
	cp -r  lib.in/gio-2.0       $(OUT_GIR_DIR)
	cp -r  lib.in/glib-2.0      $(OUT_GIR_DIR)
	cp -r  lib.in/gudev-1.0     $(OUT_GIR_DIR)

glib-2.0: lib.in/glib-2.0/glib.go.in lib.in/glib-2.0/config.json generator
	${GENERATOR} -o  $(OUT_GIR_DIR)$@ $<

gobject-2.0: lib.in/gobject-2.0/gobject.go.in lib.in/gobject-2.0/config.json generator
	${GENERATOR} -o $(OUT_GIR_DIR)$@ $<

gio-2.0:  lib.in/gio-2.0/gio.go.in lib.in/gio-2.0/config.json generator
	${GENERATOR} -o $(OUT_GIR_DIR)$@ $<

gudev-1.0: lib.in/gudev-1.0/gudev.go.in lib.in/gudev-1.0/config.json generator
	${GENERATOR} -o $(OUT_GIR_DIR)$@ $<

test:
	cd $(OUT_GIR_DIR)gobject-2.0 && ${GOTEST}
	cd $(OUT_GIR_DIR)gio-2.0 && ${GOTEST}
	cd $(OUT_GIR_DIR)glib-2.0 && ${GOTEST}
	cd $(OUT_GIR_DIR)gudev-1.0 && ${GOTEST}
	@echo "Memory Testing"
	${GORUN} test/memory.go

install:
	install -d  $(DESTDIR)$(PREFIX)/share/gocode/src/pkg.deepin.io/gir $(DESTDIR)$(PREFIX)/bin
	cp -r  $(OUT_GIR_DIR)*   $(DESTDIR)$(PREFIX)/share/gocode/src/pkg.deepin.io/gir
	cp     out/gir-generator $(DESTDIR)$(PREFIX)/bin/

clean:
	rm -fr out

.PHONY: test