Mercurial > hg-stable
annotate contrib/chg/Makefile @ 39755:7cdd47d9ccf8
chgserver: restore pager fds attached within runcommand session
While rewriting chg in Rust, I noticed the server leaks the client's pager
fd. This isn't a problem right now since the IPC process terminates earlier
than the pager, but I believe the fds attached within a "runcommand" request
should be released as soon as the session ends.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 19 Sep 2018 23:11:07 +0900 |
parents | 01c57eeb35cb |
children | 4c8d9b53b1c7 |
rev | line source |
---|---|
28060 | 1 TARGET = chg |
30693 | 2 SRCS = chg.c hgclient.c procutil.c util.c |
28060 | 3 OBJS = $(SRCS:.c=.o) |
4 | |
5 CFLAGS ?= -O2 -Wall -Wextra -pedantic -g | |
33627
5544af862286
chg: define _GNU_SOURCE to allow CentOS 5 compilation
Mathias De Maré <mathias.de_mare@nokia.com>
parents:
30738
diff
changeset
|
6 CPPFLAGS ?= -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE |
28060 | 7 override CFLAGS += -std=gnu99 |
28605
baa073200ba2
chg: allows default hg path to be overridden
Jun Wu <quark@fb.com>
parents:
28327
diff
changeset
|
8 ifdef HGPATH |
baa073200ba2
chg: allows default hg path to be overridden
Jun Wu <quark@fb.com>
parents:
28327
diff
changeset
|
9 override CPPFLAGS += -DHGPATH=\"$(HGPATH)\" |
baa073200ba2
chg: allows default hg path to be overridden
Jun Wu <quark@fb.com>
parents:
28327
diff
changeset
|
10 endif |
28060 | 11 |
12 DESTDIR = | |
13 PREFIX = /usr/local | |
14 MANDIR = $(PREFIX)/share/man/man1 | |
15 | |
16 .PHONY: all | |
17 all: $(TARGET) | |
18 | |
19 $(TARGET): $(OBJS) | |
20 $(CC) $(LDFLAGS) -o $@ $(OBJS) | |
21 | |
30693 | 22 chg.o: hgclient.h procutil.h util.h |
30738
a45c0f42271f
chg: handle pager request client-side
Jun Wu <quark@fb.com>
parents:
30693
diff
changeset
|
23 hgclient.o: hgclient.h procutil.h util.h |
30693 | 24 procutil.o: procutil.h util.h |
28060 | 25 util.o: util.h |
26 | |
27 .PHONY: install | |
28 install: $(TARGET) | |
34624
884855ce5e63
build: chg build was failing when the base directory contained spaces
muxator <a.mux@inwind.it>
parents:
33627
diff
changeset
|
29 install -d "$(DESTDIR)$(PREFIX)"/bin |
884855ce5e63
build: chg build was failing when the base directory contained spaces
muxator <a.mux@inwind.it>
parents:
33627
diff
changeset
|
30 install -m 755 "$(TARGET)" "$(DESTDIR)$(PREFIX)"/bin |
884855ce5e63
build: chg build was failing when the base directory contained spaces
muxator <a.mux@inwind.it>
parents:
33627
diff
changeset
|
31 install -d "$(DESTDIR)$(MANDIR)" |
884855ce5e63
build: chg build was failing when the base directory contained spaces
muxator <a.mux@inwind.it>
parents:
33627
diff
changeset
|
32 install -m 644 chg.1 "$(DESTDIR)$(MANDIR)" |
28060 | 33 |
34 .PHONY: clean | |
35 clean: | |
36 $(RM) $(OBJS) | |
37 | |
38 .PHONY: distclean | |
39 distclean: | |
40 $(RM) $(OBJS) $(TARGET) |