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 16include $(SRC)/cmd/Makefile.cmd 17 18PROGS = \ 19 dpio_test \ 20 gpio_attr \ 21 gpio_lookup 22 23SCRIPTS = \ 24 gpio_init \ 25 gpio_fini \ 26 gpioadm_test 27 28DATA = \ 29 attr-g0_0-H.out \ 30 attr-g0_0-Ho.out \ 31 attr-g0_0-o.out \ 32 attr-g0_0-p.out \ 33 attr-g0_0.out \ 34 attr-g0_0_filt-p.out \ 35 attr-g0_0_filt.out \ 36 ctrl-list-H-sim1.out \ 37 ctrl-list-H.out \ 38 ctrl-list-dpio-p.out \ 39 ctrl-list-p-sim1.out \ 40 ctrl-list-p.out \ 41 ctrl-list-sim1.out \ 42 ctrl-list.out \ 43 dpio-H.out \ 44 dpio-Ho.out \ 45 dpio-o.out \ 46 dpio-p.out \ 47 dpio.out \ 48 gpio-period500-H.out \ 49 gpio-period500-o.out \ 50 gpio-period500-p.out \ 51 gpio-period500.out \ 52 gpio-sim0-H.out \ 53 gpio-sim0-o.out \ 54 gpio-sim0-p.out \ 55 gpio-sim0.out \ 56 gpio-sim01-H.out \ 57 gpio-sim01-o.out \ 58 gpio-sim01-p.out \ 59 gpio-sim01.out 60 61PROGS32 = $(PROGS:%=%.32) 62PROGS64 = $(PROGS:%=%.64) 63 64ROOTOPTDIR = $(ROOT)/opt/os-tests/tests 65ROOTOPTGPIO = $(ROOTOPTDIR)/gpio 66ROOTOPTGPIODATA = $(ROOTOPTDIR)/gpio/data 67ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTGPIO)/%) \ 68 $(PROGS64:%=$(ROOTOPTGPIO)/%) \ 69 $(SCRIPTS:%=$(ROOTOPTGPIO)/%) 70ROOTOPTDATA = $(DATA:%=$(ROOTOPTGPIODATA)/%) 71$(ROOTOPTDATA) := FILEMODE = 0444 72CSTD = $(CSTD_GNU17) 73 74gpio_attr.32 := LDLIBS += -lnvpair 75gpio_attr.64 := LDLIBS64 += -lnvpair 76 77.KEEP_STATE: 78 79all: $(PROGS32) $(PROGS64) 80 81install: $(ROOTOPTPROGS) $(ROOTOPTDATA) 82 83clean: 84 85$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTGPIO) 86$(ROOTOPTDATA): $(ROOTOPTGPIODATA) 87 88$(ROOTOPTDIR): 89 $(INS.dir) 90 91$(ROOTOPTGPIO): $(ROOTOPTDIR) 92 $(INS.dir) 93 94$(ROOTOPTGPIODATA): $(ROOTOPTGPIO) 95 $(INS.dir) 96 97$(ROOTOPTGPIO)/%: % 98 $(INS.file) 99 100$(ROOTOPTGPIODATA)/%: data/% 101 $(INS.file) 102 103$(ROOTOPTGPIO)/%: %.ksh 104 $(INS.rename) 105 106%.64: %.c 107 $(LINK64.c) -o $@ $< $(LDLIBS64) 108 $(POST_PROCESS) 109 110%.32: %.c 111 $(LINK.c) -o $@ $< $(LDLIBS) 112 $(POST_PROCESS) 113 114clobber: 115 $(RM) $(PROGS32) $(PROGS64) 116 117FRC: 118