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 2018 Jason King. 14 # Copyright 2019 Joyent, Inc. 15 # 16 17 include $(SRC)/Makefile.master 18 include $(SRC)/cmd/Makefile.cmd 19 include $(SRC)/test/Makefile.com 20 21 ROOTBINDIR = $(ROOTOPTPKG)/bin 22 23 PROG = gcc-libstdc++ llvm-stdcxxabi afl-fast rust 24 25 ROOTOPTPKG = $(ROOT)/opt/util-tests 26 TESTDIR = $(ROOTOPTPKG)/tests/demangle 27 28 CMDS = $(PROG:%=$(TESTDIR)/%) 29 $(CMDS) := FILEMODE = 0555 30 31 OBJS = $(PROG:%=%.o) 32 SRCS = $(OBJS:%.o=%.c) 33 34 CSTD = $(CSTD_GNU99) 35 36 LDLIBS += -ldemangle-sys 37 rust := LDLIBS += -lumem 38 39 all: $(PROG) 40 41 gcc-libstdc++: gcc-libstdc++.o 42 $(LINK.c) -o $@ gcc-libstdc++.o $(LDLIBS) 43 $(POST_PROCESS) 44 45 llvm-stdcxxabi: llvm-stdcxxabi.o 46 $(LINK.c) -o $@ llvm-stdcxxabi.o $(LDLIBS) 47 $(POST_PROCESS) 48 49 afl-fast: afl-fast.o 50 $(LINK.c) -o $@ afl-fast.o $(LDLIBS) 51 $(POST_PROCESS) 52 53 rust: rust.o 54 $(LINK.c) -o $@ rust.o $(LDLIBS) 55 $(POST_PROCESS) 56 57 install: all $(CMDS) 58 59 lint: 60 61 clobber: clean 62 -$(RM) $(PROG) 63 64 clean: 65 -$(RM) $(OBJS) 66 67 $(CMDS): $(TESTDIR) $(PROG) 68 69 $(ROOTBINDIR): 70 $(INS.dir) 71 72 $(ROOTBINDIR)/%: % 73 $(INS.file) 74 75 $(TESTDIR): 76 $(INS.dir) 77 78 $(TESTDIR)/%: % 79 $(INS.file)