1 | # $Id: Makefile.kmk 370 2005-12-18 03:48:02Z bird $
|
---|
2 |
|
---|
3 |
|
---|
4 | #
|
---|
5 | # kmk
|
---|
6 | #
|
---|
7 | PROGRAMS += kmk
|
---|
8 |
|
---|
9 | kmk_TEMPLATE = BIN
|
---|
10 | kmk_DEPS = $(PATH_TARGET)/config.h
|
---|
11 | kmk_DEFS.win32 = __WIN32__
|
---|
12 | kmk_INCS = $(PATH_TARGET) .
|
---|
13 | #kmk_INCS.win32 = kmkbuiltin/w32
|
---|
14 |
|
---|
15 | kmk_DEFS = \
|
---|
16 | HAVE_CONFIG_H \
|
---|
17 | NO_ARCHIVES \
|
---|
18 | CONFIG_NO_DEFAULT_SUFFIXES \
|
---|
19 | CONFIG_NO_DEFAULT_PATTERN_RULES \
|
---|
20 | CONFIG_NO_DEFAULT_TERMINAL_RULES \
|
---|
21 | CONFIG_NO_DEFAULT_SUFFIX_RULES \
|
---|
22 | CONFIG_NO_DEFAULT_VARIABLES \
|
---|
23 | KMK
|
---|
24 |
|
---|
25 | kmk_SOURCES = \
|
---|
26 | main.c \
|
---|
27 | read.c \
|
---|
28 | hash.c \
|
---|
29 | variable.c \
|
---|
30 | ar.c \
|
---|
31 | arscan.c \
|
---|
32 | commands.c \
|
---|
33 | default.c \
|
---|
34 | dir.c \
|
---|
35 | expand.c \
|
---|
36 | file.c \
|
---|
37 | function.c \
|
---|
38 | implicit.c \
|
---|
39 | job.c \
|
---|
40 | misc.c \
|
---|
41 | remake.c \
|
---|
42 | rule.c \
|
---|
43 | signame.c \
|
---|
44 | version.c \
|
---|
45 | vpath.c \
|
---|
46 | remote-stub.c
|
---|
47 |
|
---|
48 | kmk_SOURCES.win32 = \
|
---|
49 | getopt.c \
|
---|
50 | getopt1.c \
|
---|
51 | getloadavg.c \
|
---|
52 | w32/subproc/misc.c \
|
---|
53 | w32/subproc/sub_proc.c \
|
---|
54 | w32/subproc/w32err.c \
|
---|
55 | glob/glob.c \
|
---|
56 | glob/fnmatch.c \
|
---|
57 | w32/compat/dirent.c \
|
---|
58 | w32/pathstuff.c
|
---|
59 |
|
---|
60 | kmk_SOURCES.freebsd = \
|
---|
61 | glob/glob.c \
|
---|
62 | glob/fnmatch.c \
|
---|
63 |
|
---|
64 | #
|
---|
65 | # kmkbuiltin commands
|
---|
66 | #
|
---|
67 | kmk_DEFS += CONFIG_WITH_KMK_BUILTIN
|
---|
68 | kmk_SOURCES += \
|
---|
69 | kmkbuiltin.c \
|
---|
70 | kmkbuiltin/append.c \
|
---|
71 | kmkbuiltin/echo.c \
|
---|
72 | kmkbuiltin/mkdir.c \
|
---|
73 | kmkbuiltin/ln.c \
|
---|
74 | kmkbuiltin/install.c \
|
---|
75 | kmkbuiltin/rm.c \
|
---|
76 | \
|
---|
77 | kmkbuiltin/err.c \
|
---|
78 | kmkbuiltin/setmode.c \
|
---|
79 | kmkbuiltin/strmode.c
|
---|
80 | ifneq ($(BUILD_TARGET),win32)
|
---|
81 | kmk_SOURCES += \
|
---|
82 | kmkbuiltin/cp.c \
|
---|
83 | kmkbuiltin/cp_utils.c \
|
---|
84 | \
|
---|
85 | kmkbuiltin/strlcpy.c
|
---|
86 | endif
|
---|
87 | kmk_SOURCES.win32 += kmkbuiltin/mscfakes.c
|
---|
88 |
|
---|
89 |
|
---|
90 | #
|
---|
91 | # Standalone kmkbuiltin commands.
|
---|
92 | #
|
---|
93 | PROGRAMS += kmk_append kmk_cp kmk_echo kmk_mkdir kmk_install kmk_ln kmk_rm
|
---|
94 |
|
---|
95 | kmk_append_TEMPLATE = BIN
|
---|
96 | kmk_append_DEFS = kmk_builtin_append=main
|
---|
97 | kmk_append_INCS = .
|
---|
98 | kmk_append_SOURCES = \
|
---|
99 | kmkbuiltin/append.c \
|
---|
100 | kmkbuiltin/err.c
|
---|
101 |
|
---|
102 | kmk_cp_TEMPLATE = BIN
|
---|
103 | kmk_cp_DEFS = kmk_builtin_cp=main
|
---|
104 | kmk_cp_SOURCES = \
|
---|
105 | kmkbuiltin/cp.c \
|
---|
106 | kmkbuiltin/cp_utils.c \
|
---|
107 | kmkbuiltin/strlcpy.c \
|
---|
108 | kmkbuiltin/err.c
|
---|
109 | kmk_cp_INCS.win32 = $(PATH_TARGET) .
|
---|
110 | kmk_cp_DEFS.win32 = HAVE_CONFIG_H
|
---|
111 | kmk_cp_SOURCES.win32 = \
|
---|
112 | kmkbuiltin/mscfakes.c \
|
---|
113 | kmkbuiltin/fts.c \
|
---|
114 | w32/compat/dirent.c \
|
---|
115 | getopt.c \
|
---|
116 | getopt1.c
|
---|
117 |
|
---|
118 | kmk_echo_TEMPLATE = BIN
|
---|
119 | kmk_echo_DEFS = kmk_builtin_echo=main
|
---|
120 | kmk_echo_SOURCES = \
|
---|
121 | kmkbuiltin/echo.c
|
---|
122 | kmk_echo_SOURCES.win32 = \
|
---|
123 | kmkbuiltin/mscfakes.c \
|
---|
124 | kmkbuiltin/err.c
|
---|
125 |
|
---|
126 | kmk_install_TEMPLATE = BIN
|
---|
127 | kmk_install_DEFS = kmk_builtin_install=main
|
---|
128 | kmk_install_SOURCES = \
|
---|
129 | kmkbuiltin/install.c \
|
---|
130 | kmkbuiltin/err.c \
|
---|
131 | kmkbuiltin/strmode.c \
|
---|
132 | kmkbuiltin/setmode.c
|
---|
133 | kmk_install_INCS.win32 = $(PATH_TARGET) .
|
---|
134 | kmk_install_DEFS.win32 = HAVE_CONFIG_H
|
---|
135 | kmk_install_SOURCES.win32 = \
|
---|
136 | kmkbuiltin/mscfakes.c \
|
---|
137 | getopt.c \
|
---|
138 | getopt1.c
|
---|
139 |
|
---|
140 | kmk_ln_TEMPLATE = BIN
|
---|
141 | kmk_ln_DEFS = kmk_builtin_ln=main
|
---|
142 | kmk_ln_SOURCES = \
|
---|
143 | kmkbuiltin/ln.c \
|
---|
144 | kmkbuiltin/err.c
|
---|
145 | kmk_ln_INCS.win32 = $(PATH_TARGET) .
|
---|
146 | kmk_ln_DEFS.win32 = HAVE_CONFIG_H
|
---|
147 | kmk_ln_SOURCES.win32 = \
|
---|
148 | kmkbuiltin/mscfakes.c\
|
---|
149 | getopt.c \
|
---|
150 | getopt1.c
|
---|
151 |
|
---|
152 | kmk_mkdir_TEMPLATE = BIN
|
---|
153 | kmk_mkdir_DEFS = kmk_builtin_mkdir=main
|
---|
154 | kmk_mkdir_SOURCES = \
|
---|
155 | kmkbuiltin/mkdir.c \
|
---|
156 | kmkbuiltin/err.c \
|
---|
157 | kmkbuiltin/setmode.c
|
---|
158 | kmk_mkdir_INCS.win32 = $(PATH_TARGET) .
|
---|
159 | kmk_mkdir_DEFS.win32 = HAVE_CONFIG_H
|
---|
160 | kmk_mkdir_SOURCES.win32 = \
|
---|
161 | kmkbuiltin/mscfakes.c \
|
---|
162 | getopt.c \
|
---|
163 | getopt1.c
|
---|
164 |
|
---|
165 | kmk_rm_TEMPLATE = BIN
|
---|
166 | kmk_rm_DEFS = kmk_builtin_rm=main
|
---|
167 | kmk_rm_SOURCES = \
|
---|
168 | kmkbuiltin/rm.c \
|
---|
169 | kmkbuiltin/err.c \
|
---|
170 | kmkbuiltin/strmode.c
|
---|
171 | kmk_rm_INCS.win32 = $(PATH_TARGET) .
|
---|
172 | kmk_rm_DEFS.win32 = HAVE_CONFIG_H
|
---|
173 | kmk_rm_SOURCES.win32 = \
|
---|
174 | kmkbuiltin/mscfakes.c\
|
---|
175 | getopt.c \
|
---|
176 | getopt1.c
|
---|
177 |
|
---|
178 |
|
---|
179 | DEPTH = ../..
|
---|
180 | include $(PATH_KBUILD)/rules.kmk
|
---|
181 |
|
---|
182 |
|
---|
183 | #
|
---|
184 | # Use checked in config.h instead of running ./Configure for it.
|
---|
185 | #
|
---|
186 | $(PATH_TARGET)/config.h: config.h.$(BUILD_TARGET)
|
---|
187 | $(MKDIR) -p $(dir $@)
|
---|
188 | $(CP) $^ $@
|
---|
189 |
|
---|
190 |
|
---|
191 | #
|
---|
192 | # Some tests.
|
---|
193 | #
|
---|
194 | parallel: parallel_1 parallel_2 parallel_3 parallel_4 parallel_5
|
---|
195 | parallel_1 parallel_2 parallel_3 parallel_4 parallel_5:
|
---|
196 | echo $@_start ; sleep 1; echo $@_done
|
---|
197 |
|
---|
198 | test:
|
---|
199 | echo "1"
|
---|
200 | echo "2"
|
---|
201 | echo "3"
|
---|
202 | echo "4"
|
---|
203 |
|
---|