Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile fixes and cleanup #664

Merged
merged 2 commits into from
Sep 30, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 25 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,36 @@ all: $(APPS)

$(BLDDIR)/%:
@mkdir -p $(dir $@)
go build ${GOFLAGS} -o $(abspath $@) ./$*

$(BINARIES): %: $(BLDDIR)/%
$(APPS): %: $(BLDDIR)/apps/%

$(BLDDIR)/apps/nsqd: $(NSQD_SRCS)
$(BLDDIR)/apps/nsqlookupd: $(NSQLOOKUPD_SRCS)
$(BLDDIR)/apps/nsqadmin: $(NSQADMIN_SRCS)
$(BLDDIR)/apps/nsq_pubsub: $(NSQ_PUBSUB_SRCS)
$(BLDDIR)/apps/nsq_to_nsq: $(NSQ_TO_NSQ_SRCS)
$(BLDDIR)/apps/nsq_to_file: $(NSQ_TO_FILE_SRCS)
$(BLDDIR)/apps/nsq_to_http: $(NSQ_TO_HTTP_SRCS)
$(BLDDIR)/apps/nsq_tail: $(NSQ_TAIL_SRCS)
$(BLDDIR)/apps/nsq_stat: $(NSQ_STAT_SRCS)
$(BLDDIR)/apps/to_nsq: $(TO_NSQ_SRCS)
go build ${GOFLAGS} -o $@ ./apps/$*

$(APPS): %: $(BLDDIR)/%

$(BLDDIR)/nsqd: $(NSQD_SRCS)
$(BLDDIR)/nsqlookupd: $(NSQLOOKUPD_SRCS)
$(BLDDIR)/nsqadmin: $(NSQADMIN_SRCS)
$(BLDDIR)/nsq_pubsub: $(NSQ_PUBSUB_SRCS)
$(BLDDIR)/nsq_to_nsq: $(NSQ_TO_NSQ_SRCS)
$(BLDDIR)/nsq_to_file: $(NSQ_TO_FILE_SRCS)
$(BLDDIR)/nsq_to_http: $(NSQ_TO_HTTP_SRCS)
$(BLDDIR)/nsq_tail: $(NSQ_TAIL_SRCS)
$(BLDDIR)/nsq_stat: $(NSQ_STAT_SRCS)
$(BLDDIR)/to_nsq: $(TO_NSQ_SRCS)

clean:
rm -fr $(BLDDIR)

.PHONY: install clean all
.PHONY: $(BINARIES)
.PHONY: $(APPS)

install: $(BINARIES) $(EXAMPLES)
install: $(APPS)
install -m 755 -d ${DESTDIR}${BINDIR}
install -m 755 $(BLDDIR)/apps/nsqlookupd ${DESTDIR}${BINDIR}/nsqlookupd
install -m 755 $(BLDDIR)/apps/nsqd ${DESTDIR}${BINDIR}/nsqd
install -m 755 $(BLDDIR)/apps/nsqadmin ${DESTDIR}${BINDIR}/nsqadmin
install -m 755 $(BLDDIR)/apps/nsq_pubsub ${DESTDIR}${BINDIR}/nsq_pubsub
install -m 755 $(BLDDIR)/apps/nsq_to_nsq ${DESTDIR}${BINDIR}/nsq_to_nsq
install -m 755 $(BLDDIR)/apps/nsq_to_file ${DESTDIR}${BINDIR}/nsq_to_file
install -m 755 $(BLDDIR)/apps/nsq_to_http ${DESTDIR}${BINDIR}/nsq_to_http
install -m 755 $(BLDDIR)/apps/nsq_tail ${DESTDIR}${BINDIR}/nsq_tail
install -m 755 $(BLDDIR)/apps/nsq_stat ${DESTDIR}${BINDIR}/nsq_stat
install -m 755 $(BLDDIR)/apps/to_nsq ${DESTDIR}${BINDIR}/to_nsq
install -m 755 $(BLDDIR)/nsqlookupd ${DESTDIR}${BINDIR}/nsqlookupd
install -m 755 $(BLDDIR)/nsqd ${DESTDIR}${BINDIR}/nsqd
install -m 755 $(BLDDIR)/nsqadmin ${DESTDIR}${BINDIR}/nsqadmin
install -m 755 $(BLDDIR)/nsq_pubsub ${DESTDIR}${BINDIR}/nsq_pubsub
install -m 755 $(BLDDIR)/nsq_to_nsq ${DESTDIR}${BINDIR}/nsq_to_nsq
install -m 755 $(BLDDIR)/nsq_to_file ${DESTDIR}${BINDIR}/nsq_to_file
install -m 755 $(BLDDIR)/nsq_to_http ${DESTDIR}${BINDIR}/nsq_to_http
install -m 755 $(BLDDIR)/nsq_tail ${DESTDIR}${BINDIR}/nsq_tail
install -m 755 $(BLDDIR)/nsq_stat ${DESTDIR}${BINDIR}/nsq_stat
install -m 755 $(BLDDIR)/to_nsq ${DESTDIR}${BINDIR}/to_nsq