-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile.tail
58 lines (44 loc) · 1.54 KB
/
Makefile.tail
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
OBJECTS = $(notdir $(CXX_OBJS:.cc=.o) $(C_OBJS:.c=.o))
CXXFLAGS = $(CFLAGS) -std=c++17
MAKEFILE_DEP = Makefile.$(TARGET_OS).dep
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $(OBJECTS)
$(CXX_OBJS:.cc=.o):
$(CXX) $(COMPAT) $(CXXFLAGS) -c $<
$(notdir $(C_OBJS:.c=.o)):
$(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c $<
%: %.in
sed -e 's,[@]VERSION[@],$(VERSION),g' \
-e 's,[@]PREFIX[@],$(PREFIX),g' \
mv [email protected] $@
PKGCONFIG = libtermcapparser.pc
install: $(TARGET) $(PKGCONFIG)
mkdir -p $(DESTDIR)$(libdir)/pkgconfig
mkdir -p $(DESTDIR)$(incdir)/$(HEADER_DIR)
$(INSTALL) -m 755 $(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
$(INSTALL) -m 644 $(PKGCONFIG) $(DESTDIR)$(libdir)/pkgconfig/$(PKGCONFIG)
$(INSTALL) -m 644 $(HEADERS) $(DESTDIR)$(incdir)/$(HEADER_DIR)
uninstall:
rm -f $(DESTDIR)$(libdir)/$(TARGET)
rm -f $(DESTDIR)$(libdir)/pkgconfig/$(PKGCONFIG)
rm -f $(DESTDIR)$(incdir)/$(HEADERS)
rmdir $(DESTDIR)$(incdir)/$(HEADER_DIR) 2>/dev/null || true
rmdir $(DESTDIR)$(libdir)/pkgconfig 2>/dev/null || true
rmdir $(DESTDIR)$(libdir) 2>/dev/null || true
install-strip:
$(MAKE) $(MFLAGS) install INSTALL="$(INSTALL) -s"
check: install
$(MAKE) $(MFLAGS) -C tests -f Makefile.$(TARGET_OS)
clean:
rm -f $(OBJECTS) $(TARGET) $(PKGCONFIG)
$(MAKE) $(MFLAGS) -C tests -f Makefile.$(TARGET_OS) clean
distclean: clean
rm -f $(MAKEFILE_DEP)
NODEP_TARGETS =
dep: $(C_OBJS) $(CXX_OBJS)
$(CC) -MM $(COMPAT) $(CFLAGS) $(XFLAGS) $^ >$(MAKEFILE_DEP)
ifeq ($(filter $(MAKECMDGOALS),$(NODEP_TARGETS)),)
-include $(MAKEFILE_DEP)
endif