Makefile
43 lines
| 895 B
| text/x-makefile
|
MakefileLexer
Yuya Nishihara
|
r28060 | TARGET = chg | ||
Jun Wu
|
r30693 | SRCS = chg.c hgclient.c procutil.c util.c | ||
Yuya Nishihara
|
r28060 | OBJS = $(SRCS:.c=.o) | ||
CFLAGS ?= -O2 -Wall -Wextra -pedantic -g | ||||
Mathias De Maré
|
r33666 | CPPFLAGS ?= -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE | ||
Yuya Nishihara
|
r28060 | override CFLAGS += -std=gnu99 | ||
Jun Wu
|
r28605 | ifdef HGPATH | ||
override CPPFLAGS += -DHGPATH=\"$(HGPATH)\" | ||||
endif | ||||
Valentin Gatien-Baron
|
r46128 | ifdef HGPATHREL | ||
override CPPFLAGS += -DHGPATHREL=\"$(HGPATHREL)\" | ||||
endif | ||||
Yuya Nishihara
|
r28060 | |||
DESTDIR = | ||||
PREFIX = /usr/local | ||||
MANDIR = $(PREFIX)/share/man/man1 | ||||
.PHONY: all | ||||
all: $(TARGET) | ||||
$(TARGET): $(OBJS) | ||||
$(CC) $(LDFLAGS) -o $@ $(OBJS) | ||||
Jun Wu
|
r30693 | chg.o: hgclient.h procutil.h util.h | ||
Jun Wu
|
r30738 | hgclient.o: hgclient.h procutil.h util.h | ||
Jun Wu
|
r30693 | procutil.o: procutil.h util.h | ||
Yuya Nishihara
|
r28060 | util.o: util.h | ||
.PHONY: install | ||||
install: $(TARGET) | ||||
muxator
|
r34625 | install -d "$(DESTDIR)$(PREFIX)"/bin | ||
install -m 755 "$(TARGET)" "$(DESTDIR)$(PREFIX)"/bin | ||||
install -d "$(DESTDIR)$(MANDIR)" | ||||
install -m 644 chg.1 "$(DESTDIR)$(MANDIR)" | ||||
Yuya Nishihara
|
r28060 | |||
.PHONY: clean | ||||
clean: | ||||
$(RM) $(OBJS) | ||||
.PHONY: distclean | ||||
distclean: | ||||
$(RM) $(OBJS) $(TARGET) | ||||