MakefileArm 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. PREFIX=/usr/local
  2. BINDIR=${PREFIX}/bin
  3. DESTDIR=
  4. BLDDIR = build
  5. BLDFLAGS=
  6. EXT=
  7. ifeq (${GOOS},windows)
  8. EXT=.exe
  9. endif
  10. APPS = nsqd nsqlookupd nsqadmin nsq_to_nsq nsq_to_file nsq_to_http nsq_tail nsq_stat to_nsq curl date
  11. all: $(APPS)
  12. $(BLDDIR)/nsqd: $(wildcard apps/nsqd/*.go nsqd/*.go nsq/*.go internal/*/*.go)
  13. $(BLDDIR)/nsqlookupd: $(wildcard apps/nsqlookupd/*.go nsqlookupd/*.go nsq/*.go internal/*/*.go)
  14. $(BLDDIR)/nsqadmin: $(wildcard apps/nsqadmin/*.go nsqadmin/*.go nsqadmin/templates/*.go internal/*/*.go)
  15. $(BLDDIR)/nsq_to_nsq: $(wildcard apps/nsq_to_nsq/*.go nsq/*.go internal/*/*.go)
  16. $(BLDDIR)/nsq_to_file: $(wildcard apps/nsq_to_file/*.go nsq/*.go internal/*/*.go)
  17. $(BLDDIR)/nsq_to_http: $(wildcard apps/nsq_to_http/*.go nsq/*.go internal/*/*.go)
  18. $(BLDDIR)/nsq_tail: $(wildcard apps/nsq_tail/*.go nsq/*.go internal/*/*.go)
  19. $(BLDDIR)/nsq_stat: $(wildcard apps/nsq_stat/*.go internal/*/*.go)
  20. $(BLDDIR)/to_nsq: $(wildcard apps/to_nsq/*.go internal/*/*.go)
  21. $(BLDDIR)/curl: $(wildcard apps/curl/*.go)
  22. $(BLDDIR)/date: $(wildcard apps/date/*.go)
  23. $(BLDDIR)/%:
  24. @mkdir -p $(dir $@)
  25. CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build ${BLDFLAGS} -o $@ ./apps/$*
  26. $(APPS): %: $(BLDDIR)/%
  27. clean:
  28. rm -fr $(BLDDIR)
  29. .PHONY: install clean all
  30. .PHONY: $(APPS)
  31. install: $(APPS)
  32. install -m 755 -d ${DESTDIR}${BINDIR}
  33. for APP in $^ ; do install -m 755 ${BLDDIR}/$$APP ${DESTDIR}${BINDIR}/$$APP${EXT} ; done