Tighten x86-64 NOP detection.
[ksplice.git] / Makefile.in
blob2af48c31baf88732a5cf234237bbe70b7bb4f4c3
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 KSPLICE_API_VERSION = @KSPLICE_API_VERSION@
20 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
22 perl_primary = ksplice-create ksplice-view ksplice-apply ksplice-undo Ksplice.pm ksplice-obj.pl
23 perl_man = $(patsubst %,%.8,$(perl_primary))
24 objutils = objmanip inspect kernel-utsname
25 itab = kmodsrc/x86/libudis86/itab.h kmodsrc/x86/libudis86/itab.c
27 have_static := $(wildcard $(srcdir)/objmanip-static)
29 default: $(perl_primary) $(perl_man) objutils $(itab)
30 @echo "Ready for 'make install'"
32 ifeq ($(strip $(have_static)),)
34 objutils: $(objutils)
36 $(addprefix install-,$(objutils)): install-%: %
37 install -m755 -D $< $(DESTDIR)$(libexecdir)/ksplice-$*
39 else
41 objutils:
43 $(addprefix install-,$(objutils)): install-%: %-static
44 install -m755 -D $< $(DESTDIR)$(libexecdir)/ksplice-$*
46 endif
48 $(perl_primary): %: %.in Makefile
49 sed 's|PACKAGE_VERSION|$(PACKAGE_VERSION)|;s|KSPLICE_API_VERSION|$(KSPLICE_API_VERSION)|;s|PACKAGE_BUGREPORT|$(PACKAGE_BUGREPORT)|;s|KSPLICE_DATA_DIR|$(datadir)/ksplice|;s|KSPLICE_LIBEXEC_DIR|$(libexecdir)|' $< > $@
51 $(perl_man): %.8: %
52 pod2man --center="Ksplice" --release="Ksplice v$(PACKAGE_VERSION)" --section=8 $< $@
54 $(objutils): %: %.c objcommon.c objcommon.h kmodsrc/ksplice.h
55 $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $< $(srcdir)/objcommon.c $(LIBS) -o $@
57 kmodsrcfiles = \
58 kmodsrc/ksplice.c \
59 kmodsrc/ksplice.h \
60 kmodsrc/x86/ksplice-arch.c \
61 kmodsrc/arm/ksplice-arch.c \
62 kmodsrc/old_code_loader.c \
63 kmodsrc/new_code_loader.c \
64 kmodsrc/Makefile \
65 kmodsrc/ksplice.lds.S \
66 kmodsrc/ksplice-rmsyms.lds \
67 kmodsrc/offsets.c \
68 kmodsrc/offsets.h \
69 kmodsrc/x86/udis86.h \
70 kmodsrc/x86/libudis86/decode.c \
71 kmodsrc/x86/libudis86/itab.c \
72 kmodsrc/x86/libudis86/syn-att.c \
73 kmodsrc/x86/libudis86/syn-intel.c \
74 kmodsrc/x86/libudis86/input.c \
75 kmodsrc/x86/libudis86/syn.c \
76 kmodsrc/x86/libudis86/udis86.c \
77 kmodsrc/x86/libudis86/decode.h \
78 kmodsrc/x86/libudis86/input.h \
79 kmodsrc/x86/libudis86/syn.h \
80 kmodsrc/x86/libudis86/extern.h \
81 kmodsrc/x86/libudis86/itab.h \
82 kmodsrc/x86/libudis86/types.h
84 $(itab): kmodsrc/x86/libudis86/x86optable.xml kmodsrc/x86/libudis86/opgen.py
85 cd kmodsrc/x86/libudis86 && python opgen.py x86optable.xml
87 $(addprefix install-,$(kmodsrcfiles)): install-%: %
88 install -m644 -D $< $(DESTDIR)$(datadir)/ksplice/$<
90 install: default $(addprefix install-,$(objutils)) $(addprefix install-,$(kmodsrcfiles))
91 install -m644 -D ksplice-create.8 $(DESTDIR)$(mandir)/man8/ksplice-create.8
92 install -m644 -D ksplice-apply.8 $(DESTDIR)$(mandir)/man8/ksplice-apply.8
93 install -m644 -D ksplice-undo.8 $(DESTDIR)$(mandir)/man8/ksplice-undo.8
94 install -m644 -D ksplice-view.8 $(DESTDIR)$(mandir)/man8/ksplice-view.8
95 install -m755 -D ksplice-create $(DESTDIR)$(bindir)/ksplice-create
96 install -m755 -D ksplice-view $(DESTDIR)$(sbindir)/ksplice-view
97 install -m755 -D ksplice-apply $(DESTDIR)$(sbindir)/ksplice-apply
98 install -m755 -D ksplice-undo $(DESTDIR)$(sbindir)/ksplice-undo
99 install -m755 -D $(srcdir)/ksplice-cc.pl $(DESTDIR)$(datadir)/ksplice/ksplice-cc.pl
100 install -m755 -D $(srcdir)/ksplice-obj.pl $(DESTDIR)$(datadir)/ksplice/ksplice-obj.pl
101 install -m644 -D $(srcdir)/ksplice-patch/ksplice-patch.h $(DESTDIR)$(datadir)/ksplice/ksplice-patch/ksplice-patch.h
102 install -m644 -D $(srcdir)/ksplice-patch/ksplice-shadow.h $(DESTDIR)$(datadir)/ksplice/ksplice-patch/ksplice-shadow.h
103 install -m644 -D $(srcdir)/Makefile.ksplice $(DESTDIR)$(datadir)/ksplice/Makefile.ksplice
104 install -m644 -D Ksplice.pm $(DESTDIR)$(datadir)/ksplice/Ksplice.pm
105 install -m644 -D Verbose.pm $(DESTDIR)$(datadir)/ksplice/Verbose.pm
107 clean:
108 rm -f $(perl_primary)
109 rm -f $(perl_man)
110 rm -f $(objutils)
112 distclean: clean
113 rm -f Makefile kmodsrc/Makefile
114 rm -f $(objutils:=-static)
115 rm -f $(itab)
116 rm -f configure config.status config.log