Abort if the core kernel text is mapped read-only.
[ksplice.git] / Makefile.in
blobf92587544d462c03f24ceae4734a9040ab02ce93
1 srcdir = @srcdir@
2 VPATH = $(srcdir)
4 prefix = @prefix@
5 exec_prefix = @exec_prefix@
6 bindir = @bindir@
7 sbindir = @sbindir@
8 libexecdir = @libexecdir@
9 mandir = @mandir@
10 datadir = @datadir@
11 datarootdir = @datarootdir@
13 CC = @CC@
14 CFLAGS = @CFLAGS@
15 CPPFLAGS = @CPPFLAGS@
16 LDFLAGS = @LDFLAGS@
17 LIBS = @LIBS@
18 PACKAGE_VERSION = @PACKAGE_VERSION@
19 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
21 perl_primary = ksplice-create ksplice-view ksplice-apply ksplice-undo Ksplice.pm ksplice-obj.pl
22 perl_man = $(patsubst %,%.8,$(perl_primary))
23 objutils = objdiff objmanip inspect
25 have_static := $(wildcard $(srcdir)/objmanip-static)
27 default: $(perl_primary) $(perl_man) objutils
28 @echo "Ready for 'make install'"
30 ifeq ($(strip $(have_static)),)
32 objutils: $(objutils)
34 $(addprefix install-,$(objutils)): install-%: %
35 install -m755 -D $< $(DESTDIR)$(libexecdir)/ksplice-$*
37 else
39 objutils:
41 $(addprefix install-,$(objutils)): install-%: %-static
42 install -m755 -D $< $(DESTDIR)$(libexecdir)/ksplice-$*
44 endif
46 $(perl_primary): %: %.in Makefile
47 sed 's|PACKAGE_VERSION|$(PACKAGE_VERSION)|;s|PACKAGE_BUGREPORT|$(PACKAGE_BUGREPORT)|;s|KSPLICE_DATA_DIR|$(datadir)/ksplice|;s|KSPLICE_LIBEXEC_DIR|$(libexecdir)|' $< > $@
49 $(perl_man): %.8: %
50 pod2man --center="Ksplice" --release="Ksplice v$(PACKAGE_VERSION)" --section=8 $< $@
52 $(objutils): %: %.c objcommon.c objcommon.h kmodsrc/ksplice.h
53 $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $< $(srcdir)/objcommon.c $(LIBS) -o $@
55 kmodsrcfiles = \
56 kmodsrc/ksplice.c \
57 kmodsrc/ksplice.h \
58 kmodsrc/x86/ksplice-arch.c \
59 kmodsrc/arm/ksplice-arch.c \
60 kmodsrc/helper.c \
61 kmodsrc/primary.c \
62 kmodsrc/Makefile \
63 kmodsrc/ld-script \
64 kmodsrc/ksplice.lds \
65 kmodsrc/x86/udis86.h \
66 kmodsrc/x86/libudis86/decode.c \
67 kmodsrc/x86/libudis86/itab.c \
68 kmodsrc/x86/libudis86/syn-att.c \
69 kmodsrc/x86/libudis86/syn-intel.c \
70 kmodsrc/x86/libudis86/input.c \
71 kmodsrc/x86/libudis86/syn.c \
72 kmodsrc/x86/libudis86/udis86.c \
73 kmodsrc/x86/libudis86/decode.h \
74 kmodsrc/x86/libudis86/input.h \
75 kmodsrc/x86/libudis86/syn.h \
76 kmodsrc/x86/libudis86/extern.h \
77 kmodsrc/x86/libudis86/itab.h \
78 kmodsrc/x86/libudis86/types.h
80 $(addprefix install-,$(kmodsrcfiles)): install-%: %
81 install -m644 -D $< $(DESTDIR)$(datadir)/ksplice/$<
83 install: default $(addprefix install-,$(objutils)) $(addprefix install-,$(kmodsrcfiles))
84 install -m644 -D ksplice-create.8 $(DESTDIR)$(mandir)/man8/ksplice-create.8
85 install -m644 -D ksplice-apply.8 $(DESTDIR)$(mandir)/man8/ksplice-apply.8
86 install -m644 -D ksplice-undo.8 $(DESTDIR)$(mandir)/man8/ksplice-undo.8
87 install -m644 -D ksplice-view.8 $(DESTDIR)$(mandir)/man8/ksplice-view.8
88 install -m755 -D ksplice-create $(DESTDIR)$(bindir)/ksplice-create
89 install -m755 -D ksplice-view $(DESTDIR)$(sbindir)/ksplice-view
90 install -m755 -D ksplice-apply $(DESTDIR)$(sbindir)/ksplice-apply
91 install -m755 -D ksplice-undo $(DESTDIR)$(sbindir)/ksplice-undo
92 install -m755 -D $(srcdir)/gendiff-reversed $(DESTDIR)$(libexecdir)/ksplice-gendiff-reversed
93 install -m755 -D $(srcdir)/ksplice-obj.pl $(DESTDIR)$(datadir)/ksplice/ksplice-obj.pl
94 install -m644 -D $(srcdir)/Makefile.ksplice $(DESTDIR)$(datadir)/ksplice/Makefile.ksplice
95 install -m644 -D Ksplice.pm $(DESTDIR)$(datadir)/ksplice/Ksplice.pm
96 install -m644 -D Verbose.pm $(DESTDIR)$(datadir)/ksplice/Verbose.pm
98 clean:
99 rm -f $(perl_primary)
100 rm -f $(perl_man)
101 rm -f $(objutils)
103 distclean: clean
104 rm -f Makefile kmodsrc/Makefile
105 rm -f $(objutils:=-static)
106 rm -f configure config.status config.log