156726c7eSRobert Mustacchi# 256726c7eSRobert Mustacchi# This file and its contents are supplied under the terms of the 356726c7eSRobert Mustacchi# Common Development and Distribution License ("CDDL"), version 1.0. 456726c7eSRobert Mustacchi# You may only use this file in accordance with the terms of version 556726c7eSRobert Mustacchi# 1.0 of the CDDL. 656726c7eSRobert Mustacchi# 756726c7eSRobert Mustacchi# A full copy of the text of the CDDL should have accompanied this 856726c7eSRobert Mustacchi# source. A copy of the CDDL is also available via the Internet at 956726c7eSRobert Mustacchi# http://www.illumos.org/license/CDDL. 1056726c7eSRobert Mustacchi# 1156726c7eSRobert Mustacchi 1256726c7eSRobert Mustacchi# 13*bb9475a1SRobert Mustacchi# Copyright 2025 Oxide Computer Company 1456726c7eSRobert Mustacchi# 1556726c7eSRobert Mustacchi 1656726c7eSRobert MustacchiPROG = elfcap.chk 1756726c7eSRobert MustacchiOBJS = elfcap_chk.o elfcap.o 1856726c7eSRobert Mustacchi 1956726c7eSRobert Mustacchiinclude $(SRC)/Makefile.master 2056726c7eSRobert Mustacchiinclude $(SRC)/Makefile.master.64 219b9d39d2SRichard Loweinclude $(SRC)/Makefile.native 2256726c7eSRobert Mustacchiinclude ../Makefile.com 2356726c7eSRobert Mustacchi 24*bb9475a1SRobert MustacchiCSTD = $(CSTD_GNU17) 2556726c7eSRobert MustacchiNATIVE_LIBS += libc.so 2673ef4869SRobert Mustacchi# 2773ef4869SRobert Mustacchi# We reach into the tools include area which provides us with a snapshot 2873ef4869SRobert Mustacchi# of all of the data that we need. This does mean that if someone is in 2973ef4869SRobert Mustacchi# bldenv and does incremental builds that change the related ELF header 3073ef4869SRobert Mustacchi# files they will need to rebuild that, but the same is true if we move 3173ef4869SRobert Mustacchi# this into tools (and it becomes more annoying). 3273ef4869SRobert Mustacchi# 339b9d39d2SRichard LoweCPPFLAGS = -I$(SRC)/tools/sgs/include $(CPPFLAGS.native) -I$(ELFCAP) 349b9d39d2SRichard LoweLDFLAGS += $(BDIRECT) 3556726c7eSRobert Mustacchi 3656726c7eSRobert Mustacchiall: $(PROG) 3756726c7eSRobert Mustacchi 3847387219SRichard Loweinstall: $(PROG) 3956726c7eSRobert Mustacchi 4056726c7eSRobert Mustacchicheck: $(PROG) 4156726c7eSRobert Mustacchi ./$(PROG) 4256726c7eSRobert Mustacchi 4356726c7eSRobert Mustacchi$(PROG): $(OBJS) 4456726c7eSRobert Mustacchi $(LINK.c) -o $@ $(OBJS) 4556726c7eSRobert Mustacchi $(POST_PROCESS) 4656726c7eSRobert Mustacchi 4756726c7eSRobert Mustacchi%.o: %.c 4856726c7eSRobert Mustacchi $(COMPILE.c) $< 4956726c7eSRobert Mustacchi 5056726c7eSRobert Mustacchi%.o: $(ELFCAP)/%.c 5156726c7eSRobert Mustacchi $(COMPILE.c) $< 5256726c7eSRobert Mustacchi 5356726c7eSRobert Mustacchiclean: 5456726c7eSRobert Mustacchi $(RM) $(OBJS) 5556726c7eSRobert Mustacchi 5656726c7eSRobert Mustacchiclobber: clean 5756726c7eSRobert Mustacchi $(RM) $(PROG) 58