2 # Makefile for the Open-iSCSI Initiator
5 # if you are packaging open-iscsi, set this variable to the location
6 # that you want everything installed into.
11 sbindir
= $(exec_prefix)/sbin
12 bindir = $(exec_prefix)/bin
13 mandir = $(prefix)/share
/man
15 initddir
= $(etcdir
)/init.d
17 MANPAGES
= doc
/iscsid
.8 doc
/iscsiadm
.8 doc
/iscsi_discovery
.8
18 PROGRAMS
= usr
/iscsid usr
/iscsiadm utils
/iscsi_discovery utils
/iscsi-iname
20 ETCFILES
= etc
/iscsid.conf
21 IFACEFILES
= etc
/iface.example
24 # using '$(MAKE)' instead of just 'make' allows make to run in parallel
25 # over multiple makefile.
30 cd utils
/open-isns
; .
/configure
--with-security
=no
; $(MAKE
)
31 $(MAKE
) -C utils
/sysdeps
32 $(MAKE
) -C utils
/fwparam_ibft
36 @echo
"Compilation complete Output file"
37 @echo
"----------------------------------- ----------------"
38 @echo
"Built iSCSI daemon: usr/iscsid"
39 @echo
"Built management application: usr/iscsiadm"
40 @echo
"Built boot tool: usr/iscsistart"
42 @echo
"Read README file for detailed information."
46 @echo
"Kernel Compilation complete Output file"
47 @echo
"----------------------------------- ----------------"
48 @echo
"Built iSCSI Open Interface module: kernel/scsi_transport_iscsi.ko"
49 @echo
"Built iSCSI library module: kernel/libiscsi.ko"
50 @echo
"Built iSCSI over TCP library module: kernel/libiscsi_tcp.ko"
51 @echo
"Built iSCSI over TCP kernel module: kernel/iscsi_tcp.ko"
56 $(MAKE
) -C utils
/sysdeps
clean
57 $(MAKE
) -C utils
/fwparam_ibft
clean
58 $(MAKE
) -C utils
clean
60 $(MAKE
) -C kernel
clean
61 $(MAKE
) -C utils
/open-isns
clean
62 $(MAKE
) -C utils
/open-isns
distclean
65 # now -jXXX will still be safe
66 # note that make may still execute the blocks in parallel
67 .NOTPARALLEL
: install_user install_programs install_initd \
68 install_initd_suse install_initd_redhat install_initd_debian \
69 install_etc install_iface install_doc install_kernel install_iname
71 install: install_programs install_doc install_etc \
72 install_initd install_iname install_iface
74 install_user
: install_programs install_doc install_etc \
75 install_initd install_iname install_iface
77 install_programs
: $(PROGRAMS
)
78 $(INSTALL
) -d
$(DESTDIR
)$(sbindir
)
79 $(INSTALL
) -m
755 $^
$(DESTDIR
)$(sbindir
)
81 # ugh, auto-detection is evil
82 # Gentoo maintains their own init.d stuff
84 if
[ -f
/etc
/debian_version
]; then \
85 $(MAKE
) install_initd_debian
; \
86 elif
[ -f
/etc
/redhat-release
]; then \
87 $(MAKE
) install_initd_redhat
; \
88 elif
[ -f
/etc
/SuSE-release
]; then \
89 $(MAKE
) install_initd_suse
; \
92 # these are external targets to allow bypassing distribution detection
94 $(INSTALL
) -d
$(DESTDIR
)$(initddir
)
95 $(INSTALL
) -m
755 etc
/initd
/initd.suse \
96 $(DESTDIR
)$(initddir
)/open-iscsi
97 $(INSTALL
) -m
755 etc
/initd
/boot.suse \
98 $(DESTDIR
)$(initddir
)/boot.open-iscsi
100 install_initd_redhat
:
101 $(INSTALL
) -d
$(DESTDIR
)$(initddir
)
102 $(INSTALL
) -m
755 etc
/initd
/initd.redhat \
103 $(DESTDIR
)$(initddir
)/open-iscsi
105 install_initd_debian
:
106 $(INSTALL
) -d
$(DESTDIR
)$(initddir
)
107 $(INSTALL
) -m
755 etc
/initd
/initd.debian \
108 $(DESTDIR
)$(initddir
)/open-iscsi
110 install_iface
: $(IFACEFILES
)
111 $(INSTALL
) -d
$(DESTDIR
)$(etcdir
)/iscsi
/ifaces
112 $(INSTALL
) -m
644 $^
$(DESTDIR
)$(etcdir
)/iscsi
/ifaces
114 install_etc
: $(ETCFILES
)
115 if
[ ! -f
/etc
/iscsi
/iscsid.conf
]; then \
116 $(INSTALL
) -d
$(DESTDIR
)$(etcdir
)/iscsi
; \
117 $(INSTALL
) -m
644 $^
$(DESTDIR
)$(etcdir
)/iscsi
; \
120 install_doc
: $(MANPAGES
)
121 $(INSTALL
) -d
$(DESTDIR
)$(mandir)/man8
122 $(INSTALL
) -m
644 $^
$(DESTDIR
)$(mandir)/man8
125 $(MAKE
) -C kernel install_kernel
128 if
[ ! -f
/etc
/iscsi
/initiatorname.iscsi
]; then \
129 echo
"InitiatorName=`$(DESTDIR)/sbin/iscsi-iname`" > $(DESTDIR
)/etc
/iscsi
/initiatorname.iscsi
; \
130 echo
"***************************************************" ; \
131 echo
"Setting InitiatorName to `cat $(DESTDIR)/etc/iscsi/initiatorname.iscsi`" ; \
132 echo
"To override edit /etc/iscsi/initiatorname.iscsi" ; \
133 echo
"***************************************************" ; \
137 for
dir in usr utils utils
/fwparam_ibft
; do \
138 $(MAKE
) -C
$$dir $@
; \
141 # vim: ft=make tw=72 sw=4 ts=4: