Simplify Makefile (#205)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
This commit is contained in:
parent
924f6f120a
commit
a6dfc26959
27
Makefile
27
Makefile
|
@ -5,7 +5,7 @@ CGO_ENABLED ?= 0
|
||||||
GOOS ?= linux
|
GOOS ?= linux
|
||||||
|
|
||||||
all: $(SERVICES)
|
all: $(SERVICES)
|
||||||
.PHONY: all $(SERVICES) docker
|
.PHONY: all $(SERVICES) dockers
|
||||||
|
|
||||||
define compile_service
|
define compile_service
|
||||||
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) go build -ldflags "-s -w" -o ${BUILD_DIR}/mainflux-$(1) cmd/$(1)/main.go
|
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) go build -ldflags "-s -w" -o ${BUILD_DIR}/mainflux-$(1) cmd/$(1)/main.go
|
||||||
|
@ -18,16 +18,7 @@ endef
|
||||||
proto:
|
proto:
|
||||||
protoc --go_out=. *.proto
|
protoc --go_out=. *.proto
|
||||||
|
|
||||||
manager: proto
|
$(SERVICES): proto
|
||||||
$(call compile_service,$(@))
|
|
||||||
|
|
||||||
http: proto
|
|
||||||
$(call compile_service,$(@))
|
|
||||||
|
|
||||||
normalizer: proto
|
|
||||||
$(call compile_service,$(@))
|
|
||||||
|
|
||||||
coap: proto
|
|
||||||
$(call compile_service,$(@))
|
$(call compile_service,$(@))
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -36,17 +27,7 @@ clean:
|
||||||
install:
|
install:
|
||||||
cp ${BUILD_DIR}/* $(GOBIN)
|
cp ${BUILD_DIR}/* $(GOBIN)
|
||||||
|
|
||||||
# Docker
|
$(DOCKERS):
|
||||||
docker_manager:
|
|
||||||
$(call make_docker,$(@))
|
$(call make_docker,$(@))
|
||||||
|
|
||||||
docker_http:
|
dockers: $(DOCKERS)
|
||||||
$(call make_docker,$(@))
|
|
||||||
|
|
||||||
docker_normalizer:
|
|
||||||
$(call make_docker,$(@))
|
|
||||||
|
|
||||||
docker_coap:
|
|
||||||
$(call make_docker,$(@))
|
|
||||||
|
|
||||||
docker: $(DOCKERS)
|
|
||||||
|
|
Loading…
Reference in New Issue