Print this page
Commonize demangle test pieces; allow for running specific tests and test cases; use linker sets to simplify test definition
   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)
   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)/cmd/Makefile.ctf
  20 include $(SRC)/test/Makefile.com
  21 
  22 ROOTBINDIR = $(ROOTOPTPKG)/bin
  23 
  24 PROG = cxx rust
  25 
  26 OBJS_common = main.o
  27 OBJS_rust = rust.o
  28 OBJS_cxx = afl-fast.o gcc-libstdc++.o llvm-stdcxxabi.o
  29 
  30 ROOTOPTPKG = $(ROOT)/opt/util-tests
  31 TESTDIR = $(ROOTOPTPKG)/tests/demangle
  32 
  33 CMDS = $(PROG:%=$(TESTDIR)/%)
  34 $(CMDS) := FILEMODE = 0555
  35 
  36 cxx := OBJS = $(OBJS_common) $(OBJS_cxx)
  37 rust := OBJS = $(OBJS_common) $(OBJS_cxx)
  38 
  39 $(OBJS_rust) $(OBJS_cxx) := SMATCH = off
  40 
  41 SRCS = $(OBJS:%.o=%.c)
  42 
  43 CSTD = $(CSTD_GNU99)
  44 
  45 LDLIBS += -ldemangle-sys -lumem

  46 
  47 all: $(PROG)
  48 
  49 cxx: $(OBJS_common) $(OBJS_cxx)
  50         $(LINK.c) -o $@ $(OBJS_common) $(OBJS_cxx) $(LDLIBS)
  51         $(POST_PROCESS)
  52 
  53 rust: $(OBJS_rust)
  54         $(LINK.c) -o $@ $(OBJS_common) $(OBJS_rust) $(LDLIBS)
  55         $(POST_PROCESS)
  56 








  57 install: all $(CMDS)
  58 


  59 clobber: clean
  60         -$(RM) $(PROG)
  61 
  62 clean:
  63         -$(RM) $(OBJ_common) $(OBJS_cxx) $(OBJS_rust)
  64 
  65 $(CMDS): $(TESTDIR) $(PROG)
  66 
  67 $(ROOTBINDIR):
  68         $(INS.dir)
  69 
  70 $(ROOTBINDIR)/%: %
  71         $(INS.file)
  72 
  73 $(TESTDIR):
  74         $(INS.dir)
  75 
  76 $(TESTDIR)/%: %
  77         $(INS.file)