annotate contrib/chg/Makefile @ 47333:69530e5d4fe5

dirstate-tree: Add `NodeRef` and `ChildNodesRef` enums They are used instead of `&Node` and `&ChildNodes` respectively. The `ChildNodes` type alias also becomes a similar enum. For now they only have one variant each, to be extended later. Adding enums now forces various use sites go through new methods instead of manipulating the underlying data structure directly. Differential Revision: https://phab.mercurial-scm.org/D10747
author Simon Sapin <simon.sapin@octobus.net>
date Wed, 19 May 2021 13:15:00 +0200
parents 4c8d9b53b1c7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28060
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
1 TARGET = chg
30693
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents: 30513
diff changeset
2 SRCS = chg.c hgclient.c procutil.c util.c
28060
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
3 OBJS = $(SRCS:.c=.o)
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
4
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
5 CFLAGS ?= -O2 -Wall -Wextra -pedantic -g
33629
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
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
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
45551
4c8d9b53b1c7 chg: make is possible to call by default an hg binary located next to chg
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 34655
diff changeset
11 ifdef HGPATHREL
4c8d9b53b1c7 chg: make is possible to call by default an hg binary located next to chg
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 34655
diff changeset
12 override CPPFLAGS += -DHGPATHREL=\"$(HGPATHREL)\"
4c8d9b53b1c7 chg: make is possible to call by default an hg binary located next to chg
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 34655
diff changeset
13 endif
28060
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
14
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
15 DESTDIR =
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
16 PREFIX = /usr/local
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
17 MANDIR = $(PREFIX)/share/man/man1
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
18
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
19 .PHONY: all
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
20 all: $(TARGET)
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
21
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
22 $(TARGET): $(OBJS)
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
23 $(CC) $(LDFLAGS) -o $@ $(OBJS)
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
24
30693
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents: 30513
diff changeset
25 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
26 hgclient.o: hgclient.h procutil.h util.h
30693
baee0f47b533 chg: add procutil.h
Jun Wu <quark@fb.com>
parents: 30513
diff changeset
27 procutil.o: procutil.h util.h
28060
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
28 util.o: util.h
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
29
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
30 .PHONY: install
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
31 install: $(TARGET)
34624
884855ce5e63 build: chg build was failing when the base directory contained spaces
muxator <a.mux@inwind.it>
parents: 33629
diff changeset
32 install -d "$(DESTDIR)$(PREFIX)"/bin
884855ce5e63 build: chg build was failing when the base directory contained spaces
muxator <a.mux@inwind.it>
parents: 33629
diff changeset
33 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: 33629
diff changeset
34 install -d "$(DESTDIR)$(MANDIR)"
884855ce5e63 build: chg build was failing when the base directory contained spaces
muxator <a.mux@inwind.it>
parents: 33629
diff changeset
35 install -m 644 chg.1 "$(DESTDIR)$(MANDIR)"
28060
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
36
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
37 .PHONY: clean
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
38 clean:
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
39 $(RM) $(OBJS)
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
40
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
41 .PHONY: distclean
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
42 distclean:
726f8d6cc324 chg: import frontend sources
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
43 $(RM) $(OBJS) $(TARGET)