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
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]
23 # Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
29 # sort provides a number of debugging options to simplify failure analysis.
31 # debug provides symbol information and sets DEBUG; includes
33 # stats builds binaries with statistics reporting enabled
34 # convert builds convert binaries (converts input to collation
36 # invoke builds invoke binaries (allows inspection of options
40 # DEBUG activate assertions; allow wider range of memory
42 # DEBUG_FORCE_WIDE force all i/o through wide streams
43 # DEBUG_DISALLOW_MMAP force all i/o through stdio or wide streams
44 # DEBUG_NO_CACHE_TEMP do not cache last sorted portion in memory; write all
45 # data to temporary files before merge
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 XPG4OBJS = $(OBJS:%.o=xpg4_%.o)
70 SRCS = $(OBJS:%.o=../common/%.c)
71 LNTS = $(OBJS:%.o=%.ln)
72 CLEANFILES = $(OBJS) $(XPG4OBJS) $(LNTS)
74 include ../../Makefile.cmd
82 CFLAGS += $(CCVERBOSE) $(SORT_DEBUG)
83 CFLAGS64 += $(CCVERBOSE) $(SORT_DEBUG)
84 CPPFLAGS += -D_FILE_OFFSET_BITS=64
85 LINTFLAGS += -U_FILE_OFFSET_BITS
87 CERRWARN += -_gcc=-Wno-parentheses
88 CERRWARN += -_gcc=-Wno-uninitialized
89 CERRWARN += -_gcc=-Wno-unused-function
91 $(XPG4) := CFLAGS += -DXPG4
93 debug := SORT_DEBUG = -g -DDEBUG $(ILDOFF)
96 stats := SORT_DEBUG = -g -DSTATS -DDEBUG $(ILDOFF)
102 .PARALLEL : $(OBJS) $(XPG4OBJS) $(LNTS)
104 all : $(PROG) $(XPG4)
106 debug : $(PROG) convert invoke
109 $(LINT.c) $(LINTFLAGS) $(LNTS) $(LDLIBS)
114 include ../../Makefile.targ
116 # rules for $(PROG) and $(XPG4)
119 $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
122 $(XPG4) : $(XPG4OBJS)
123 $(LINK.c) -o $@ $(XPG4OBJS) $(LDLIBS)
126 invoke: $(INVOKE_OBJS)
127 $(LINK.c) -o $@ $(INVOKE_OBJS) $(LDLIBS)
129 convert: $(CONVERT_OBJS)
130 $(LINK.c) -o $@ $(CONVERT_OBJS) $(LDLIBS)
133 $(LINK.c) -o $@ $(STATS_OBJS) $(LDLIBS)
136 $(COMPILE.c) -o $@ $<
139 xpg4_%.o : ../common/%.c
140 $(COMPILE.c) -o $@ $<
143 %.o : ../common/%.h types.h
145 xpg4_%.o : ../common/%.h types.h
148 $(LINT.c) $(LINTFLAGS) -c $<