Change applied flag to a three-state enum.
[ksplice.git] / Makefile.in
blob5f70eef121ea53ffc9de18a4317f4250221ef869
1 prefix = @prefix@
2 exec_prefix = @exec_prefix@
3 bindir = @bindir@
4 sbindir = @sbindir@
5 libexecdir = @libexecdir@
6 mandir = @mandir@
7 datadir = @datadir@
8 datarootdir = @datarootdir@
10 CC = @CC@
11 CFLAGS = @CFLAGS@
12 CPPFLAGS = @CPPFLAGS@
13 CCFLAGS = $(CFLAGS) @bfd_include_dir@
14 LDFLAGS = @LDFLAGS@
15 LIBS = @LIBS@
16 SED = @SED@
17 PACKAGE_VERSION = @PACKAGE_VERSION@
18 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
20 perl_primary = ksplice-create ksplice-view ksplice-apply ksplice-undo ksplice.pm
21 perl_man = $(patsubst %,%.8,$(perl_primary))
23 have_static := $(wildcard objmanip-static)
25 default: $(perl_primary) $(perl_man) objutils
26 @echo "Ready for 'make install'"
28 ifeq ($(strip $(have_static)),)
30 objutils: objdiff objmanip
32 install-objdiff: objdiff
33 install -m755 -D objdiff $(DESTDIR)$(libexecdir)/ksplice-objdiff
35 install-objmanip: objmanip
36 install -m755 -D objmanip $(DESTDIR)$(libexecdir)/ksplice-objmanip
38 else
40 objutils:
42 install-objdiff:
43 install -m755 -D objdiff-static $(DESTDIR)$(libexecdir)/ksplice-objdiff
45 install-objmanip:
46 install -m755 -D objmanip-static $(DESTDIR)$(libexecdir)/ksplice-objmanip
48 endif
50 $(perl_primary): %: %.in Makefile
51 $(SED) 's|PACKAGE_VERSION|$(PACKAGE_VERSION)|;s|PACKAGE_BUGREPORT|$(PACKAGE_BUGREPORT)|;s|KSPLICE_DATA_DIR|$(datadir)/ksplice|;s|KSPLICE_LIBEXEC_DIR|$(libexecdir)|' $< > $@
53 $(perl_man): %.8: %
54 pod2man --center="Ksplice" --release="Ksplice v$(PACKAGE_VERSION)" --section=8 $< $@
56 objdiff objmanip: objdiff.c objmanip.c objcommon.c objcommon.h allcommon-user
57 $(CC) $(CCFLAGS) $(LDFLAGS) $@.c objcommon.c allcommon-user $(LIBS) -o $@
59 allcommon-user: kmodsrc/allcommon.c kmodsrc/allcommon.h
60 $(CC) -c kmodsrc/allcommon.c -o $@
62 install: default install-objmanip install-objdiff
63 install -m644 -D ksplice-create.8 $(DESTDIR)$(mandir)/man8/ksplice-create.8
64 install -m644 -D ksplice-apply.8 $(DESTDIR)$(mandir)/man8/ksplice-apply.8
65 install -m644 -D ksplice-undo.8 $(DESTDIR)$(mandir)/man8/ksplice-undo.8
66 install -m644 -D ksplice-view.8 $(DESTDIR)$(mandir)/man8/ksplice-view.8
67 install -m755 -D ksplice-create $(DESTDIR)$(bindir)/ksplice-create
68 install -m755 -D ksplice-view $(DESTDIR)$(bindir)/ksplice-view
69 install -m755 -D ksplice-apply $(DESTDIR)$(sbindir)/ksplice-apply
70 install -m755 -D ksplice-undo $(DESTDIR)$(sbindir)/ksplice-undo
71 install -m755 -D gendiff-reversed $(DESTDIR)$(libexecdir)/ksplice-gendiff-reversed
72 install -m644 -D ksplice.pm $(DESTDIR)$(datadir)/ksplice/ksplice.pm
73 install -m644 -D kmodsrc/helper.c $(DESTDIR)$(datadir)/ksplice/kmodsrc/helper.c
74 install -m644 -D kmodsrc/helper.h $(DESTDIR)$(datadir)/ksplice/kmodsrc/helper.h
75 install -m644 -D kmodsrc/primary.c $(DESTDIR)$(datadir)/ksplice/kmodsrc/primary.c
76 install -m644 -D kmodsrc/primary.h $(DESTDIR)$(datadir)/ksplice/kmodsrc/primary.h
77 install -m644 -D kmodsrc/modcommon.c $(DESTDIR)$(datadir)/ksplice/kmodsrc/modcommon.c
78 install -m644 -D kmodsrc/modcommon.h $(DESTDIR)$(datadir)/ksplice/kmodsrc/modcommon.h
79 install -m644 -D kmodsrc/allcommon.c $(DESTDIR)$(datadir)/ksplice/kmodsrc/allcommon.c
80 install -m644 -D kmodsrc/allcommon.h $(DESTDIR)$(datadir)/ksplice/kmodsrc/allcommon.h
81 install -m644 -D kmodsrc/jumps.h $(DESTDIR)$(datadir)/ksplice/kmodsrc/jumps.h
82 install -m644 -D kmodsrc/nops.h $(DESTDIR)$(datadir)/ksplice/kmodsrc/nops.h
83 install -m644 -D kmodsrc/Makefile $(DESTDIR)$(datadir)/ksplice/kmodsrc/Makefile
84 install -m644 -D kmodsrc/ld-script $(DESTDIR)$(datadir)/ksplice/kmodsrc/ld-script
86 clean:
87 rm -f $(perl_primary)
88 rm -f $(perl_man)
89 rm -f objdiff objmanip allcommon-user
91 distclean: clean
92 rm -f Makefile
93 rm -f objdiff-static objmanip-static
94 rm -f configure config.status config.log