Merge commit '00f1a4f432b3d8aad1aa270e91c44c57f03ef407'
[unleashed.git] / usr / src / cmd / sort / Makefile.com
blobd6c3c448367f68ef707a031fef10dbe707b91bb6
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.
28 # Debugging targets
29 #   sort provides a number of debugging options to simplify failure analysis.
31 #   debug               provides symbol information and sets DEBUG; includes
32 #                       convert, invoke
33 #   stats               builds binaries with statistics reporting enabled
34 #   convert             builds convert binaries (converts input to collation
35 #                       vectors)
36 #   invoke              builds invoke binaries (allows inspection of options
37 #                       parser outcome)
39 # Debugging #defines
40 #   DEBUG               activate assertions; allow wider range of memory
41 #                       settings (-S)
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
48 PROG = sort
50 BASE_OBJS = \
51         check.o \
52         fields.o \
53         initialize.o \
54         internal.o \
55         merge.o \
56         options.o \
57         streams.o \
58         streams_array.o \
59         streams_mmap.o \
60         streams_stdio.o \
61         streams_wide.o \
62         utility.o
63 OBJS =  main.o $(BASE_OBJS)
64 INVOKE_OBJS = invoke.o $(BASE_OBJS)
65 CONVERT_OBJS = convert.o $(BASE_OBJS)
66 STATS_OBJS = main.o statistics.o $(BASE_OBJS)
68 SRCS =  $(OBJS:%.o=../common/%.c)
69 LNTS =  $(OBJS:%.o=%.ln)
70 CLEANFILES = $(OBJS) $(LNTS)
72 include ../../Makefile.cmd
74 SED =           sed
75 DCFILE =        $(PROG).dc
77 CFLAGS +=       $(SORT_DEBUG)
78 CFLAGS64 +=     $(SORT_DEBUG)
79 CPPFLAGS +=     -D_FILE_OFFSET_BITS=64
81 CERRWARN +=     -Wno-parentheses
82 CERRWARN +=     -Wno-uninitialized
83 CERRWARN +=     -Wno-unused-function
85 CFLAGS += -DXPG4
87 debug :=        SORT_DEBUG = -g -DDEBUG
88 debug :=        COPTFLAG =
89 debug :=        COPTFLAG64 =
90 stats   :=      SORT_DEBUG = -g -DSTATS -DDEBUG
91 stats   :=      COPTFLAG =
92 stats   :=      COPTFLAG64 =
94 .KEEP_STATE :
96 .PARALLEL : $(OBJS) $(XPG4OBJS) $(LNTS)
98 all : $(PROG)
100 debug : $(PROG) convert invoke
102 clean :
103         $(RM) $(CLEANFILES)
105 include ../../Makefile.targ
107 # rules for $(PROG)
109 $(PROG) : $(OBJS)
110         $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
111         $(POST_PROCESS)
113 invoke: $(INVOKE_OBJS)
114         $(LINK.c) -o $@ $(INVOKE_OBJS) $(LDLIBS)
116 convert: $(CONVERT_OBJS)
117         $(LINK.c) -o $@ $(CONVERT_OBJS) $(LDLIBS)
119 stats: $(STATS_OBJS)
120         $(LINK.c) -o $@ $(STATS_OBJS) $(LDLIBS)
122 %.o : ../common/%.c
123         $(COMPILE.c) -o $@ $<
124         $(POST_PROCESS_O)
127 %.o : ../common/%.h types.h