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