-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
43 lines (29 loc) · 814 Bytes
/
Makefile
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
ifeq ($(MYTARGDIR),)
MYTARGDIR:=target
endif
CONF_NAME=kurz.conf
ifeq ($(STATIC_DIR),)
STATIC_DIR:=share/kurz
endif
TARG=src/kurz
CLEANFILES=$(MYTARGDIR)
all: bin-dist
$(TARG): src/*.go
@go build -o $(TARG) src/*.go
test: src/*.go
go test src/*.go
clean:
@rm -rf $(CLEANFILES)
@rm -rf $(TARG)
bin-dist: $(TARG) assets
@cp -rf conf/kurz.conf $(MYTARGDIR)/etc/kurz/
@sed 's?=static?=$(STATIC_DIR)?' conf/$(CONF_NAME) > $(MYTARGDIR)/etc/kurz/$(CONF_NAME)
@cp $(TARG) $(MYTARGDIR)/bin
@git log --pretty=format:"kurz.go %H" -1 > $(MYTARGDIR)/$(STATIC_DIR)/_version
assets: directories
@cp -r stuff/assets/* $(MYTARGDIR)/$(STATIC_DIR)
directories:
@mkdir -p $(MYTARGDIR)/$(STATIC_DIR)
@mkdir -p $(MYTARGDIR)/etc/kurz/
@mkdir -p $(MYTARGDIR)/bin
.PHONY: clean bin-dist assets directories test