xref: /titanic_52/usr/src/grub/grub-0.97/util/Makefile.solaris (revision e5803b76927480e8f9b67b22201c484ccf4c2bcf)
1#
2# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
3# Use is subject to license terms.
4#
5# ident	"%Z%%M%	%I%	%E% SMI"
6#
7include ../../Makefile.grub
8include ../Makefile.solaris.defs
9
10
11INCLUDES	= -I. -I.. -I../lib -I../docs
12LIBCOMMON	= ../lib/libcommon.a
13
14# Build these only if the OPTION_UTILS on is on (blank).
15$(OPTION_UTILS)PROGRAMS = mbchk
16
17
18# Build these only if the OPTION_UTILS on is on (blank).
19# Will be installed.
20$(OPTION_UTILS)INSTALL_SCRIPTS = grub-install		\
21				 grub-md5-crypt		\
22				 grub-set-default	\
23				 grub-terminfo
24# Won't be installed.
25$(OPTION_UTILS)NOINSTALL_SCRIPTS = grub-image
26
27SCRIPTS		= $(INSTALL_SCRIPTS) $(NOINSTALL_SCRIPTS)
28
29
30INSTALL_BINDIR	= $(ROOT_PLAT_GRUB)/bin
31INSTALL_SBINDIR	= $(ROOT_PLAT_GRUB)/sbin
32
33INSTALL_TARGETS	= $(PROGRAMS:%=$(INSTALL_BINDIR)/%) \
34		  $(INSTALL_SCRIPTS:%=$(INSTALL_SBINDIR)/%)
35
36$(INSTALL_BINDIR)/%  := FILEMODE = 0555
37$(INSTALL_SBINDIR)/% := FILEMODE = 0555
38
39#
40# Source files to be installed in $(SRC_DIR).
41#
42SRC_DIR		= $(ROOT_SRC)/util
43SRC_FILES	= Makefile.am Makefile.in grub-image.in grub-install.in \
44		  grub-md5-crypt.in grub-set-default.in grub-terminfo.in \
45		  mbchk.c mkbimage
46
47INSTALL_TARGETS	+= $(SRC_FILES:%=$(SRC_DIR)/%)
48
49
50all: $(PROGRAMS) $(SCRIPTS)
51
52$(PROGRAMS): $$@.o
53	$(RM) $@
54	$(LINK) -o $@ $@.o $(LIBCOMMON)
55
56$(SCRIPTS): $$@.in ../config.status.solaris
57	cd .. && ./config.status.solaris util/$@
58
59
60install: all $(INSTALL_TARGETS)
61
62$(INSTALL_BINDIR)/%: $(INSTALL_BINDIR) %
63	$(INS.file)
64
65$(INSTALL_SBINDIR)/%: $(INSTALL_SBINDIR) %
66	$(INS.file)
67
68$(SRC_DIR)/%: $(SRC_DIR) %
69	$(INS.file)
70
71$(INSTALL_BINDIR) $(INSTALL_SBINDIR) $(SRC_DIR):
72	$(INS.dir)
73
74
75clean: _FORCE
76	$(RM) *.o $(NOINSTALL_SCRIPTS)
77
78clobber: clean
79	$(RM) $(PROGRAMS) $(INSTALL_SCRIPTS)
80
81_FORCE:
82