xref: /illumos-gate/usr/src/cmd/sgs/elfcap.chk/Makefile (revision 012e6ce759c490003aed29439cc47d3d73a99ad3)
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 ../Makefile.com
22
23CSTD =		$(GNU_C99)
24NATIVE_LIBS +=	libc.so
25#
26# We reach into the tools include area which provides us with a snapshot
27# of all of the data that we need. This does mean that if someone is in
28# bldenv and does incremental builds that change the related ELF header
29# files they will need to rebuild that, but the same is true if we move
30# this into tools (and it becomes more annoying).
31#
32CPPFLAGS =	-I$(SRC)/tools/sgs/include $(CPPFLAGS.native)
33CFLAGS =	$(NATIVE_CFLAGS)
34CC =		$(NATIVECC)
35LDCHECKS =
36
37CPPFLAGS += -I$(ELFCAP)
38
39all: $(PROG)
40
41install: $(PROG)
42
43check: $(PROG)
44	./$(PROG)
45
46$(PROG): $(OBJS)
47	$(LINK.c) -o $@ $(OBJS)
48	$(POST_PROCESS)
49
50%.o: %.c
51	$(COMPILE.c) $<
52
53%.o: $(ELFCAP)/%.c
54	$(COMPILE.c) $<
55
56clean:
57	$(RM) $(OBJS)
58
59clobber: clean
60	$(RM) $(PROG)
61