contrib/chg/Makefile
changeset 34655 01c57eeb35cb
parent 34624 884855ce5e63
child 45551 4c8d9b53b1c7
equal deleted inserted replaced
34654:4182d2065e7a 34655:01c57eeb35cb
     1 HG = $(CURDIR)/../../hg
       
     2 
       
     3 TARGET = chg
     1 TARGET = chg
     4 SRCS = chg.c hgclient.c procutil.c util.c
     2 SRCS = chg.c hgclient.c procutil.c util.c
     5 OBJS = $(SRCS:.c=.o)
     3 OBJS = $(SRCS:.c=.o)
     6 
     4 
     7 CFLAGS ?= -O2 -Wall -Wextra -pedantic -g
     5 CFLAGS ?= -O2 -Wall -Wextra -pedantic -g
    12 endif
    10 endif
    13 
    11 
    14 DESTDIR =
    12 DESTDIR =
    15 PREFIX = /usr/local
    13 PREFIX = /usr/local
    16 MANDIR = $(PREFIX)/share/man/man1
    14 MANDIR = $(PREFIX)/share/man/man1
    17 
       
    18 CHGSOCKDIR = /tmp/chg$(shell id -u)
       
    19 CHGSOCKNAME = $(CHGSOCKDIR)/server
       
    20 
    15 
    21 .PHONY: all
    16 .PHONY: all
    22 all: $(TARGET)
    17 all: $(TARGET)
    23 
    18 
    24 $(TARGET): $(OBJS)
    19 $(TARGET): $(OBJS)
    34 	install -d "$(DESTDIR)$(PREFIX)"/bin
    29 	install -d "$(DESTDIR)$(PREFIX)"/bin
    35 	install -m 755 "$(TARGET)" "$(DESTDIR)$(PREFIX)"/bin
    30 	install -m 755 "$(TARGET)" "$(DESTDIR)$(PREFIX)"/bin
    36 	install -d "$(DESTDIR)$(MANDIR)"
    31 	install -d "$(DESTDIR)$(MANDIR)"
    37 	install -m 644 chg.1 "$(DESTDIR)$(MANDIR)"
    32 	install -m 644 chg.1 "$(DESTDIR)$(MANDIR)"
    38 
    33 
    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
    34 .PHONY: clean
    47 clean:
    35 clean:
    48 	$(RM) $(OBJS)
    36 	$(RM) $(OBJS)
    49 
    37 
    50 .PHONY: distclean
    38 .PHONY: distclean