xref: /illumos-gate/usr/src/test/util-tests/tests/demangle/Makefile (revision 8226594fdd4479be135127f43632f1f995074654)
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
17include $(SRC)/Makefile.master
18include $(SRC)/cmd/Makefile.cmd
19include $(SRC)/test/Makefile.com
20
21ROOTBINDIR = $(ROOTOPTPKG)/bin
22
23PROG = gcc-libstdc++ llvm-stdcxxabi afl-fast rust
24
25ROOTOPTPKG = $(ROOT)/opt/util-tests
26TESTDIR = $(ROOTOPTPKG)/tests/demangle
27
28CMDS = $(PROG:%=$(TESTDIR)/%)
29$(CMDS) := FILEMODE = 0555
30
31OBJS = $(PROG:%=%.o)
32SRCS = $(OBJS:%.o=%.c)
33
34CSTD = $(CSTD_GNU99)
35
36LDLIBS += -ldemangle-sys
37rust := LDLIBS += -lumem
38
39all: $(PROG)
40
41gcc-libstdc++: gcc-libstdc++.o
42	$(LINK.c) -o $@ gcc-libstdc++.o $(LDLIBS)
43	$(POST_PROCESS)
44
45llvm-stdcxxabi: llvm-stdcxxabi.o
46	$(LINK.c) -o $@ llvm-stdcxxabi.o $(LDLIBS)
47	$(POST_PROCESS)
48
49afl-fast: afl-fast.o
50	$(LINK.c) -o $@ afl-fast.o $(LDLIBS)
51	$(POST_PROCESS)
52
53rust: rust.o
54	$(LINK.c) -o $@ rust.o $(LDLIBS)
55	$(POST_PROCESS)
56
57install: all $(CMDS)
58
59lint:
60
61clobber: clean
62	-$(RM) $(PROG)
63
64clean:
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)
80