12345678910111213141516171819202122232425262728293031323334353637383940 |
- PREFIX=/usr/local
- BINDIR=${PREFIX}/bin
- DESTDIR=
- BLDDIR = build
- BLDFLAGS=
- EXT=
- ifeq (${GOOS},windows)
- EXT=.exe
- endif
- APPS = nsqd nsqlookupd nsqadmin nsq_to_nsq nsq_to_file nsq_to_http nsq_tail nsq_stat to_nsq curl date
- all: $(APPS)
- $(BLDDIR)/nsqd: $(wildcard apps/nsqd/*.go nsqd/*.go nsq/*.go internal/*/*.go)
- $(BLDDIR)/nsqlookupd: $(wildcard apps/nsqlookupd/*.go nsqlookupd/*.go nsq/*.go internal/*/*.go)
- $(BLDDIR)/nsqadmin: $(wildcard apps/nsqadmin/*.go nsqadmin/*.go nsqadmin/templates/*.go internal/*/*.go)
- $(BLDDIR)/nsq_to_nsq: $(wildcard apps/nsq_to_nsq/*.go nsq/*.go internal/*/*.go)
- $(BLDDIR)/nsq_to_file: $(wildcard apps/nsq_to_file/*.go nsq/*.go internal/*/*.go)
- $(BLDDIR)/nsq_to_http: $(wildcard apps/nsq_to_http/*.go nsq/*.go internal/*/*.go)
- $(BLDDIR)/nsq_tail: $(wildcard apps/nsq_tail/*.go nsq/*.go internal/*/*.go)
- $(BLDDIR)/nsq_stat: $(wildcard apps/nsq_stat/*.go internal/*/*.go)
- $(BLDDIR)/to_nsq: $(wildcard apps/to_nsq/*.go internal/*/*.go)
- $(BLDDIR)/curl: $(wildcard apps/curl/*.go)
- $(BLDDIR)/date: $(wildcard apps/date/*.go)
- $(BLDDIR)/%:
- @mkdir -p $(dir $@)
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build ${BLDFLAGS} -o $@ ./apps/$*
- $(APPS): %: $(BLDDIR)/%
- clean:
- rm -fr $(BLDDIR)
- .PHONY: install clean all
- .PHONY: $(APPS)
- install: $(APPS)
- install -m 755 -d ${DESTDIR}${BINDIR}
- for APP in $^ ; do install -m 755 ${BLDDIR}/$$APP ${DESTDIR}${BINDIR}/$$APP${EXT} ; done
|