-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (41 loc) · 1014 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
44
45
46
47
48
49
50
51
SHELL=/bin/zsh # necesario porque bash en OS X no tiene globstar
# macros
GB := $(shell command -v gb)
GULP := $(shell command -v gulp)
# source files
gosrc := $(shell ls src/**/*.go)
staticsrc := $(shell ls static/app/**/*.*)
# default
all: app
# archivos requeridos
bin/registro: $(gosrc)
ifndef GB
$(error "gb no está instalado. Obtenlo en http://getgb.io")
endif
gb build
bin/registro-linux-amd64: $(gosrc)
ifndef GB
$(error "gb no está instalado. Obtenlo en http://getgb.io")
endif
env GOOS=linux GOARCH=amd64 gb build
static/dist: $(staticsrc)
ifndef GULP
$(error "gulp no está instalado. Obtenlo en https://webpack.github.io")
endif
cd static && \
gulp build
# aliases
frontend: static/dist
backend: bin/registro
backend_linux: bin/registro-linux-amd64
app: frontend backend
mkdir -p build
cp -r bin/registro build/registro
cp -r static/dist build/static
docker: frontend backend_linux
docker-compose build
clean:
rm -rf bin
rm -rf pkg
rm -rf static/dist
rm -rf build