xref: /illumos-gate/usr/src/cmd/sgs/elfcap.chk/Makefile (revision 8119dad84d6416f13557b0ba8e2aaf9064cbcfd3)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12#
13# Copyright 2022 Oxide Computer Company
14#
15
16PROG	= elfcap.chk
17OBJS	= elfcap_chk.o elfcap.o
18
19include	$(SRC)/Makefile.master
20include	$(SRC)/Makefile.master.64
21include	$(SRC)/Makefile.native
22include	../Makefile.com
23
24CSTD =		$(GNU_C99)
25NATIVE_LIBS +=	libc.so
26#
27# We reach into the tools include area which provides us with a snapshot
28# of all of the data that we need. This does mean that if someone is in
29# bldenv and does incremental builds that change the related ELF header
30# files they will need to rebuild that, but the same is true if we move
31# this into tools (and it becomes more annoying).
32#
33CPPFLAGS =	-I$(SRC)/tools/sgs/include $(CPPFLAGS.native) -I$(ELFCAP)
34LDFLAGS += $(BDIRECT)
35
36all: $(PROG)
37
38install: $(PROG)
39
40check: $(PROG)
41	./$(PROG)
42
43$(PROG): $(OBJS)
44	$(LINK.c) -o $@ $(OBJS)
45	$(POST_PROCESS)
46
47%.o: %.c
48	$(COMPILE.c) $<
49
50%.o: $(ELFCAP)/%.c
51	$(COMPILE.c) $<
52
53clean:
54	$(RM) $(OBJS)
55
56clobber: clean
57	$(RM) $(PROG)
58