Show More
@@ -1,52 +1,52 b'' | |||
|
1 | 1 | HG = $(CURDIR)/../../hg |
|
2 | 2 | |
|
3 | 3 | TARGET = chg |
|
4 | 4 | SRCS = chg.c hgclient.c procutil.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 -D_GNU_SOURCE |
|
9 | 9 | override CFLAGS += -std=gnu99 |
|
10 | 10 | ifdef HGPATH |
|
11 | 11 | override CPPFLAGS += -DHGPATH=\"$(HGPATH)\" |
|
12 | 12 | endif |
|
13 | 13 | |
|
14 | 14 | DESTDIR = |
|
15 | 15 | PREFIX = /usr/local |
|
16 | 16 | MANDIR = $(PREFIX)/share/man/man1 |
|
17 | 17 | |
|
18 | 18 | CHGSOCKDIR = /tmp/chg$(shell id -u) |
|
19 | 19 | CHGSOCKNAME = $(CHGSOCKDIR)/server |
|
20 | 20 | |
|
21 | 21 | .PHONY: all |
|
22 | 22 | all: $(TARGET) |
|
23 | 23 | |
|
24 | 24 | $(TARGET): $(OBJS) |
|
25 | 25 | $(CC) $(LDFLAGS) -o $@ $(OBJS) |
|
26 | 26 | |
|
27 | 27 | chg.o: hgclient.h procutil.h util.h |
|
28 | 28 | hgclient.o: hgclient.h procutil.h util.h |
|
29 | 29 | procutil.o: procutil.h util.h |
|
30 | 30 | util.o: util.h |
|
31 | 31 | |
|
32 | 32 | .PHONY: install |
|
33 | 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) | |
|
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 | 38 | |
|
39 | 39 | .PHONY: serve |
|
40 | 40 | serve: |
|
41 | [ -d $(CHGSOCKDIR) ] || ( umask 077; mkdir $(CHGSOCKDIR) ) | |
|
42 | $(HG) serve --cwd / --cmdserver chgunix \ | |
|
41 | [ -d "$(CHGSOCKDIR)" ] || ( umask 077; mkdir "$(CHGSOCKDIR)" ) | |
|
42 | "$(HG)" serve --cwd / --cmdserver chgunix \ | |
|
43 | 43 | --address $(CHGSOCKNAME) \ |
|
44 | 44 | --config cmdserver.log=/dev/stderr |
|
45 | 45 | |
|
46 | 46 | .PHONY: clean |
|
47 | 47 | clean: |
|
48 | 48 | $(RM) $(OBJS) |
|
49 | 49 | |
|
50 | 50 | .PHONY: distclean |
|
51 | 51 | distclean: |
|
52 | 52 | $(RM) $(OBJS) $(TARGET) |
General Comments 0
You need to be logged in to leave comments.
Login now