Mercurial > hg
annotate contrib/chg/Makefile @ 30832:da5fa0f13a41
ui: introduce an experimental dict of exportable environment variables
Care needs to be taken to prevent leaking potentially sensitive environment
variables through hgweb, if template support for environment variables is to be
introduced. There are a few ideas about the API for preventing accidental
leaking [1]. Option 3 seems best from the POV of not needing to configure
anything in the normal case. I couldn't figure out how to do that, so guard it
with an experimental option for now.
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-January/092383.html
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 17 Jan 2017 23:05:12 -0500 |
parents | a45c0f42271f |
children | 5544af862286 |
rev | line source |
---|---|
28062
1000ccf804a6
chg: use in-tree hg executable to start server for testing
Yuya Nishihara <yuya@tcha.org>
parents:
28060
diff
changeset
|
1 HG = $(CURDIR)/../../hg |
28060 | 2 |
3 TARGET = chg | |
30693 | 4 SRCS = chg.c hgclient.c procutil.c util.c |
28060 | 5 OBJS = $(SRCS:.c=.o) |
6 | |
7 CFLAGS ?= -O2 -Wall -Wextra -pedantic -g | |
8 CPPFLAGS ?= -D_FORTIFY_SOURCE=2 | |
9 override CFLAGS += -std=gnu99 | |
28605
baa073200ba2
chg: allows default hg path to be overridden
Jun Wu <quark@fb.com>
parents:
28327
diff
changeset
|
10 ifdef HGPATH |
baa073200ba2
chg: allows default hg path to be overridden
Jun Wu <quark@fb.com>
parents:
28327
diff
changeset
|
11 override CPPFLAGS += -DHGPATH=\"$(HGPATH)\" |
baa073200ba2
chg: allows default hg path to be overridden
Jun Wu <quark@fb.com>
parents:
28327
diff
changeset
|
12 endif |
28060 | 13 |
14 DESTDIR = | |
15 PREFIX = /usr/local | |
16 MANDIR = $(PREFIX)/share/man/man1 | |
17 | |
18 CHGSOCKDIR = /tmp/chg$(shell id -u) | |
19 CHGSOCKNAME = $(CHGSOCKDIR)/server | |
20 | |
21 .PHONY: all | |
22 all: $(TARGET) | |
23 | |
24 $(TARGET): $(OBJS) | |
25 $(CC) $(LDFLAGS) -o $@ $(OBJS) | |
26 | |
30693 | 27 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
|
28 hgclient.o: hgclient.h procutil.h util.h |
30693 | 29 procutil.o: procutil.h util.h |
28060 | 30 util.o: util.h |
31 | |
32 .PHONY: install | |
33 install: $(TARGET) | |
34 install -d $(DESTDIR)$(PREFIX)/bin | |
35 install -m 755 $(TARGET) $(DESTDIR)$(PREFIX)/bin | |
36 install -d $(DESTDIR)$(MANDIR) | |
37 install -m 644 chg.1 $(DESTDIR)$(MANDIR) | |
38 | |
39 .PHONY: serve | |
40 serve: | |
41 [ -d $(CHGSOCKDIR) ] || ( umask 077; mkdir $(CHGSOCKDIR) ) | |
42 $(HG) serve --cwd / --cmdserver chgunix \ | |
43 --address $(CHGSOCKNAME) \ | |
44 --config cmdserver.log=/dev/stderr | |
45 | |
46 .PHONY: clean | |
47 clean: | |
48 $(RM) $(OBJS) | |
49 | |
50 .PHONY: distclean | |
51 distclean: | |
52 $(RM) $(OBJS) $(TARGET) |