xref: /illumos-gate/usr/src/uts/intel/elfexec/Makefile (revision a5f69788de7ac07553de47f7fec8c05a9a94c105)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# uts/intel/elfexec/Makefile
24#
25# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28#pragma ident	"%Z%%M%	%I%	%E% SMI"
29#
30#	This makefile drives the production of the elfexec exec kernel
31#	module.
32#
33#	intel architecture dependent
34#
35
36#
37#	Path to the base of the uts directory tree (usually /usr/src/uts).
38#
39UTSBASE	= ../..
40
41#
42#	Define the module and object file sets.
43#
44MODULE		= elfexec
45ELFEXEC_OBJS_32	=
46ELFEXEC_OBJS_64	= elf32.o elf32_notes.o old32_notes.o
47ELFEXEC_OBJS	+= $(ELFEXEC_OBJS_$(CLASS))
48OBJECTS		= $(ELFEXEC_OBJS:%=$(OBJS_DIR)/%)
49LINTS		= $(ELFEXEC_OBJS:%.o=$(LINTS_DIR)/%.ln)
50ROOTMODULE	= $(ROOT_EXEC_DIR)/$(MODULE)
51
52#
53#	Include common rules.
54#
55include $(UTSBASE)/intel/Makefile.intel
56
57#
58#	Define targets
59#
60ALL_TARGET	= $(BINARY)
61LINT_TARGET	= $(MODULE).lint
62INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
63
64#
65#	Default build targets.
66#
67.KEEP_STATE:
68
69def:		$(DEF_DEPS)
70
71all:		$(ALL_DEPS)
72
73clean:		$(CLEAN_DEPS)
74
75clobber:	$(CLOBBER_DEPS)
76
77lint:		$(LINT_DEPS)
78
79modlintlib:	$(MODLINTLIB_DEPS)
80
81clean.lint:	$(CLEAN_LINT_DEPS)
82
83install:	$(INSTALL_DEPS)
84
85#
86#	Include common targets.
87#
88include $(UTSBASE)/intel/Makefile.targ
89
90.NO_PARALLEL:	$(LINTS)
91
92$(OBJS_DIR)/elf32.o:	$(UTSBASE)/common/exec/elf/elf.c
93	$(COMPILE.c) -o $@ -D_ELF32_COMPAT $(UTSBASE)/common/exec/elf/elf.c
94
95$(OBJS_DIR)/elf32_notes.o: $(UTSBASE)/common/exec/elf/elf_notes.c
96	$(COMPILE.c) -o $@ -D_ELF32_COMPAT $(UTSBASE)/common/exec/elf/elf_notes.c
97
98$(OBJS_DIR)/old32_notes.o: $(UTSBASE)/common/exec/elf/old_notes.c
99	$(COMPILE.c) -o $@ -D_ELF32_COMPAT $(UTSBASE)/common/exec/elf/old_notes.c
100
101$(LINTS_DIR)/elf32.ln:	$(UTSBASE)/common/exec/elf/elf.c
102	@($(LHEAD) $(LINT.c) -Celf32 -D_ELF32_COMPAT $(UTSBASE)/common/exec/elf/elf.c $(LTAIL))
103	@$(MV) $(@F) $@
104
105$(LINTS_DIR)/elf32_notes.ln: $(UTSBASE)/common/exec/elf/elf_notes.c
106	@($(LHEAD) $(LINT.c) -Celf32_notes -D_ELF32_COMPAT $(UTSBASE)/common/exec/elf/elf_notes.c $(LTAIL))
107	@$(MV) $(@F) $@
108
109$(LINTS_DIR)/old32_notes.ln: $(UTSBASE)/common/exec/elf/old_notes.c
110	@($(LHEAD) $(LINT.c) -Cold32_notes -D_ELF32_COMPAT $(UTSBASE)/common/exec/elf/old_notes.c $(LTAIL))
111	@$(MV) $(@F) $@
112