Unleashed v1.4
[unleashed.git] / usr / src / cmd / sort / Makefile.com
blobabe0fe5d07122ce4c1765b384dd529636e39330b
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License, Version 1.0 only
6 # (the "License").  You may not use this file except in compliance
7 # with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
20 # CDDL HEADER END
23 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24 # Use is subject to license terms.
26 # Copyright (c) 2018, Joyent, Inc.
29 # Debugging targets
30 #   sort provides a number of debugging options to simplify failure analysis.
32 #   debug               provides symbol information and sets DEBUG; includes
33 #                       convert, invoke
34 #   stats               builds binaries with statistics reporting enabled
35 #   convert             builds convert binaries (converts input to collation
36 #                       vectors)
37 #   invoke              builds invoke binaries (allows inspection of options
38 #                       parser outcome)
40 # Debugging #defines
41 #   DEBUG               activate assertions; allow wider range of memory
42 #                       settings (-S)
43 #   DEBUG_FORCE_WIDE    force all i/o through wide streams
44 #   DEBUG_DISALLOW_MMAP force all i/o through stdio or wide streams
45 #   DEBUG_NO_CACHE_TEMP do not cache last sorted portion in memory; write all
46 #                       data to temporary files before merge
49 PROG = sort
51 BASE_OBJS = \
52         check.o \
53         fields.o \
54         initialize.o \
55         internal.o \
56         merge.o \
57         options.o \
58         streams.o \
59         streams_array.o \
60         streams_mmap.o \
61         streams_stdio.o \
62         streams_wide.o \
63         utility.o
64 OBJS =  main.o $(BASE_OBJS)
65 INVOKE_OBJS = invoke.o $(BASE_OBJS)
66 CONVERT_OBJS = convert.o $(BASE_OBJS)
67 STATS_OBJS = main.o statistics.o $(BASE_OBJS)
69 SRCS =  $(OBJS:%.o=../common/%.c)
70 LNTS =  $(OBJS:%.o=%.ln)
71 CLEANFILES = $(OBJS) $(LNTS)
73 include ../../Makefile.cmd
75 SED =           sed
76 DCFILE =        $(PROG).dc
78 CFLAGS +=       $(SORT_DEBUG)
79 CFLAGS64 +=     $(SORT_DEBUG)
81 CERRWARN +=     -Wno-parentheses
82 CERRWARN +=     -Wno-uninitialized
83 CERRWARN +=     -Wno-unused-function
85 # not linted
86 SMATCH=off
88 CFLAGS += -DXPG4
90 debug :=        SORT_DEBUG = -g -DDEBUG
91 debug :=        COPTFLAG =
92 debug :=        COPTFLAG64 =
93 stats   :=      SORT_DEBUG = -g -DSTATS -DDEBUG
94 stats   :=      COPTFLAG =
95 stats   :=      COPTFLAG64 =
97 .KEEP_STATE :
99 .PARALLEL : $(OBJS) $(XPG4OBJS) $(LNTS)
101 all : $(PROG)
103 debug : $(PROG) convert invoke
105 clean :
106         $(RM) $(CLEANFILES)
108 include ../../Makefile.targ
110 # rules for $(PROG)
112 $(PROG) : $(OBJS)
113         $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
114         $(POST_PROCESS)
116 invoke: $(INVOKE_OBJS)
117         $(LINK.c) -o $@ $(INVOKE_OBJS) $(LDLIBS)
119 convert: $(CONVERT_OBJS)
120         $(LINK.c) -o $@ $(CONVERT_OBJS) $(LDLIBS)
122 stats: $(STATS_OBJS)
123         $(LINK.c) -o $@ $(STATS_OBJS) $(LDLIBS)
125 %.o : ../common/%.c
126         $(COMPILE.c) -o $@ $<
127         $(POST_PROCESS_O)
130 %.o : ../common/%.h types.h