##// END OF EJS Templates
chg: use in-tree hg executable to start server for testing
Yuya Nishihara -
r28062:1000ccf8 default
parent child Browse files
Show More
@@ -1,50 +1,50 b''
1 HG = hg
1 HG = $(CURDIR)/../../hg
2 2
3 3 TARGET = chg
4 4 SRCS = chg.c hgclient.c util.c
5 5 OBJS = $(SRCS:.c=.o)
6 6
7 7 CFLAGS ?= -O2 -Wall -Wextra -pedantic -g
8 8 CPPFLAGS ?= -D_FORTIFY_SOURCE=2
9 9 override CFLAGS += -std=gnu99
10 10
11 11 DESTDIR =
12 12 PREFIX = /usr/local
13 13 MANDIR = $(PREFIX)/share/man/man1
14 14
15 15 CHGSOCKDIR = /tmp/chg$(shell id -u)
16 16 CHGSOCKNAME = $(CHGSOCKDIR)/server
17 17
18 18 .PHONY: all
19 19 all: $(TARGET)
20 20
21 21 $(TARGET): $(OBJS)
22 22 $(CC) $(LDFLAGS) -o $@ $(OBJS)
23 23
24 24 chg.o: hgclient.h util.h
25 25 hgclient.o: hgclient.h util.h
26 26 util.o: util.h
27 27
28 28 .PHONY: install
29 29 install: $(TARGET)
30 30 install -d $(DESTDIR)$(PREFIX)/bin
31 31 install -m 755 $(TARGET) $(DESTDIR)$(PREFIX)/bin
32 32 install -d $(DESTDIR)$(MANDIR)
33 33 install -m 644 chg.1 $(DESTDIR)$(MANDIR)
34 34
35 35 .PHONY: serve
36 36 serve:
37 37 [ -d $(CHGSOCKDIR) ] || ( umask 077; mkdir $(CHGSOCKDIR) )
38 38 $(HG) serve --cwd / --cmdserver chgunix \
39 39 --address $(CHGSOCKNAME) \
40 40 --config extensions.chgserver= \
41 41 --config progress.assume-tty=1 \
42 42 --config cmdserver.log=/dev/stderr
43 43
44 44 .PHONY: clean
45 45 clean:
46 46 $(RM) $(OBJS)
47 47
48 48 .PHONY: distclean
49 49 distclean:
50 50 $(RM) $(OBJS) $(TARGET)
General Comments 0
You need to be logged in to leave comments. Login now