Merge tag 'powerpc-5.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux-2.6-microblaze.git] / scripts / Makefile.lib
1 # SPDX-License-Identifier: GPL-2.0
2 # Backward compatibility
3 asflags-y  += $(EXTRA_AFLAGS)
4 ccflags-y  += $(EXTRA_CFLAGS)
5 cppflags-y += $(EXTRA_CPPFLAGS)
6 ldflags-y  += $(EXTRA_LDFLAGS)
7 ifneq ($(always),)
8 $(warning 'always' is deprecated. Please use 'always-y' instead)
9 always-y   += $(always)
10 endif
11 ifneq ($(hostprogs-y),)
12 $(warning 'hostprogs-y' is deprecated. Please use 'hostprogs' instead)
13 hostprogs  += $(hostprogs-y)
14 endif
15 ifneq ($(hostprogs-m),)
16 $(warning 'hostprogs-m' is deprecated. Please use 'hostprogs' instead)
17 hostprogs  += $(hostprogs-m)
18 endif
19
20 # flags that take effect in current and sub directories
21 KBUILD_AFLAGS += $(subdir-asflags-y)
22 KBUILD_CFLAGS += $(subdir-ccflags-y)
23
24 # Figure out what we need to build from the various variables
25 # ===========================================================================
26
27 # When an object is listed to be built compiled-in and modular,
28 # only build the compiled-in version
29 obj-m := $(filter-out $(obj-y),$(obj-m))
30
31 # Libraries are always collected in one lib file.
32 # Filter out objects already built-in
33 lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m)))
34
35 # Subdirectories we need to descend into
36 subdir-ym := $(sort $(subdir-y) $(subdir-m) \
37                         $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-m))))
38
39 # Handle objects in subdirs:
40 # - If we encounter foo/ in $(obj-y), replace it by foo/built-in.a and
41 #   foo/modules.order
42 # - If we encounter foo/ in $(obj-m), replace it by foo/modules.order
43 #
44 # Generate modules.order to determine modorder. Unfortunately, we don't have
45 # information about ordering between -y and -m subdirs. Just put -y's first.
46
47 ifdef need-modorder
48 obj-m := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m))
49 else
50 obj-m := $(filter-out %/, $(obj-m))
51 endif
52
53 ifdef need-builtin
54 obj-y           := $(patsubst %/, %/built-in.a, $(obj-y))
55 else
56 obj-y           := $(filter-out %/, $(obj-y))
57 endif
58
59 # If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object
60 multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))), $(m))))
61 multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))), $(m))))
62 multi-used   := $(multi-used-y) $(multi-used-m)
63
64 # Replace multi-part objects by their individual parts,
65 # including built-in.a from subdirectories
66 real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
67 real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m)))
68
69 always-y += $(always-m)
70
71 # hostprogs-always-y += foo
72 # ... is a shorthand for
73 # hostprogs += foo
74 # always-y  += foo
75 hostprogs += $(hostprogs-always-y) $(hostprogs-always-m)
76 always-y += $(hostprogs-always-y) $(hostprogs-always-m)
77
78 # userprogs-always-y is likewise.
79 userprogs += $(userprogs-always-y) $(userprogs-always-m)
80 always-y += $(userprogs-always-y) $(userprogs-always-m)
81
82 # DTB
83 # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built
84 extra-y                         += $(dtb-y)
85 extra-$(CONFIG_OF_ALL_DTBS)     += $(dtb-)
86
87 ifneq ($(CHECK_DTBS),)
88 extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y))
89 extra-y += $(patsubst %.dtbo,%.dt.yaml, $(dtb-y))
90 extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-))
91 extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtbo,%.dt.yaml, $(dtb-))
92 endif
93
94 # Add subdir path
95
96 extra-y         := $(addprefix $(obj)/,$(extra-y))
97 always-y        := $(addprefix $(obj)/,$(always-y))
98 targets         := $(addprefix $(obj)/,$(targets))
99 obj-m           := $(addprefix $(obj)/,$(obj-m))
100 lib-y           := $(addprefix $(obj)/,$(lib-y))
101 real-obj-y      := $(addprefix $(obj)/,$(real-obj-y))
102 real-obj-m      := $(addprefix $(obj)/,$(real-obj-m))
103 multi-used-m    := $(addprefix $(obj)/,$(multi-used-m))
104 subdir-ym       := $(addprefix $(obj)/,$(subdir-ym))
105
106 # Finds the multi-part object the current object will be linked into.
107 # If the object belongs to two or more multi-part objects, list them all.
108 modname-multi = $(sort $(foreach m,$(multi-used),\
109                 $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$(m:.o=))))
110
111 __modname = $(if $(modname-multi),$(modname-multi),$(basetarget))
112
113 modname = $(subst $(space),:,$(__modname))
114 modfile = $(addprefix $(obj)/,$(__modname))
115
116 # target with $(obj)/ and its suffix stripped
117 target-stem = $(basename $(patsubst $(obj)/%,%,$@))
118
119 # These flags are needed for modversions and compiling, so we define them here
120 # $(modname_flags) defines KBUILD_MODNAME as the name of the module it will
121 # end up in (or would, if it gets compiled in)
122 name-fix = $(call stringify,$(subst $(comma),_,$(subst -,_,$1)))
123 basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget))
124 modname_flags  = -DKBUILD_MODNAME=$(call name-fix,$(modname))
125 modfile_flags  = -DKBUILD_MODFILE=$(call stringify,$(modfile))
126
127 _c_flags       = $(filter-out $(CFLAGS_REMOVE_$(target-stem).o), \
128                      $(filter-out $(ccflags-remove-y), \
129                          $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(ccflags-y)) \
130                      $(CFLAGS_$(target-stem).o))
131 _a_flags       = $(filter-out $(AFLAGS_REMOVE_$(target-stem).o), \
132                      $(filter-out $(asflags-remove-y), \
133                          $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(asflags-y)) \
134                      $(AFLAGS_$(target-stem).o))
135 _cpp_flags     = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(target-stem).lds)
136
137 #
138 # Enable gcov profiling flags for a file, directory or for all files depending
139 # on variables GCOV_PROFILE_obj.o, GCOV_PROFILE and CONFIG_GCOV_PROFILE_ALL
140 # (in this order)
141 #
142 ifeq ($(CONFIG_GCOV_KERNEL),y)
143 _c_flags += $(if $(patsubst n%,, \
144                 $(GCOV_PROFILE_$(basetarget).o)$(GCOV_PROFILE)$(CONFIG_GCOV_PROFILE_ALL)), \
145                 $(CFLAGS_GCOV))
146 endif
147
148 #
149 # Enable address sanitizer flags for kernel except some files or directories
150 # we don't want to check (depends on variables KASAN_SANITIZE_obj.o, KASAN_SANITIZE)
151 #
152 ifeq ($(CONFIG_KASAN),y)
153 ifneq ($(CONFIG_KASAN_HW_TAGS),y)
154 _c_flags += $(if $(patsubst n%,, \
155                 $(KASAN_SANITIZE_$(basetarget).o)$(KASAN_SANITIZE)y), \
156                 $(CFLAGS_KASAN), $(CFLAGS_KASAN_NOSANITIZE))
157 endif
158 endif
159
160 ifeq ($(CONFIG_UBSAN),y)
161 _c_flags += $(if $(patsubst n%,, \
162                 $(UBSAN_SANITIZE_$(basetarget).o)$(UBSAN_SANITIZE)$(CONFIG_UBSAN_SANITIZE_ALL)), \
163                 $(CFLAGS_UBSAN))
164 endif
165
166 ifeq ($(CONFIG_KCOV),y)
167 _c_flags += $(if $(patsubst n%,, \
168         $(KCOV_INSTRUMENT_$(basetarget).o)$(KCOV_INSTRUMENT)$(CONFIG_KCOV_INSTRUMENT_ALL)), \
169         $(CFLAGS_KCOV))
170 endif
171
172 #
173 # Enable KCSAN flags except some files or directories we don't want to check
174 # (depends on variables KCSAN_SANITIZE_obj.o, KCSAN_SANITIZE)
175 #
176 ifeq ($(CONFIG_KCSAN),y)
177 _c_flags += $(if $(patsubst n%,, \
178         $(KCSAN_SANITIZE_$(basetarget).o)$(KCSAN_SANITIZE)y), \
179         $(CFLAGS_KCSAN))
180 endif
181
182 # $(srctree)/$(src) for including checkin headers from generated source files
183 # $(objtree)/$(obj) for including generated headers from checkin source files
184 ifeq ($(KBUILD_EXTMOD),)
185 ifdef building_out_of_srctree
186 _c_flags   += -I $(srctree)/$(src) -I $(objtree)/$(obj)
187 _a_flags   += -I $(srctree)/$(src) -I $(objtree)/$(obj)
188 _cpp_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj)
189 endif
190 endif
191
192 part-of-module = $(if $(filter $(basename $@).o, $(real-obj-m)),y)
193 quiet_modtag = $(if $(part-of-module),[M],   )
194
195 modkern_cflags =                                          \
196         $(if $(part-of-module),                           \
197                 $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \
198                 $(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL) $(modfile_flags))
199
200 modkern_aflags = $(if $(part-of-module),                                \
201                         $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE),       \
202                         $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL))
203
204 c_flags        = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE)     \
205                  -include $(srctree)/include/linux/compiler_types.h       \
206                  $(_c_flags) $(modkern_cflags)                           \
207                  $(basename_flags) $(modname_flags)
208
209 a_flags        = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE)     \
210                  $(_a_flags) $(modkern_aflags)
211
212 cpp_flags      = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE)     \
213                  $(_cpp_flags)
214
215 ld_flags       = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
216
217 DTC_INCLUDE    := $(srctree)/scripts/dtc/include-prefixes
218
219 dtc_cpp_flags  = -Wp,-MMD,$(depfile).pre.tmp -nostdinc                    \
220                  $(addprefix -I,$(DTC_INCLUDE))                          \
221                  -undef -D__DTS__
222
223 # Useful for describing the dependency of composite objects
224 # Usage:
225 #   $(call multi_depend, multi_used_targets, suffix_to_remove, suffix_to_add)
226 define multi_depend
227 $(foreach m, $(notdir $1), \
228         $(eval $(obj)/$m: \
229         $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s)))))))
230 endef
231
232 quiet_cmd_copy = COPY    $@
233       cmd_copy = cp $< $@
234
235 # Shipped files
236 # ===========================================================================
237
238 quiet_cmd_shipped = SHIPPED $@
239 cmd_shipped = cat $< > $@
240
241 $(obj)/%: $(src)/%_shipped
242         $(call cmd,shipped)
243
244 # Commands useful for building a boot image
245 # ===========================================================================
246 #
247 #       Use as following:
248 #
249 #       target: source(s) FORCE
250 #               $(if_changed,ld/objcopy/gzip)
251 #
252 #       and add target to extra-y so that we know we have to
253 #       read in the saved command line
254
255 # Linking
256 # ---------------------------------------------------------------------------
257
258 quiet_cmd_ld = LD      $@
259       cmd_ld = $(LD) $(ld_flags) $(real-prereqs) -o $@
260
261 # Archive
262 # ---------------------------------------------------------------------------
263
264 quiet_cmd_ar = AR      $@
265       cmd_ar = rm -f $@; $(AR) cDPrsT $@ $(real-prereqs)
266
267 # Objcopy
268 # ---------------------------------------------------------------------------
269
270 quiet_cmd_objcopy = OBJCOPY $@
271 cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
272
273 # Gzip
274 # ---------------------------------------------------------------------------
275
276 quiet_cmd_gzip = GZIP    $@
277       cmd_gzip = cat $(real-prereqs) | $(KGZIP) -n -f -9 > $@
278
279 # DTC
280 # ---------------------------------------------------------------------------
281 DTC ?= $(objtree)/scripts/dtc/dtc
282 DTC_FLAGS += -Wno-interrupt_provider
283
284 # Disable noisy checks by default
285 ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
286 DTC_FLAGS += -Wno-unit_address_vs_reg \
287         -Wno-unit_address_format \
288         -Wno-avoid_unnecessary_addr_size \
289         -Wno-alias_paths \
290         -Wno-graph_child_address \
291         -Wno-simple_bus_reg \
292         -Wno-unique_unit_address \
293         -Wno-pci_device_reg
294 endif
295
296 ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),)
297 DTC_FLAGS += -Wnode_name_chars_strict \
298         -Wproperty_name_chars_strict \
299         -Winterrupt_provider
300 endif
301
302 DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
303
304 # Generate an assembly file to wrap the output of the device tree compiler
305 quiet_cmd_dt_S_dtb= DTB     $@
306 cmd_dt_S_dtb=                                           \
307 {                                                       \
308         echo '\#include <asm-generic/vmlinux.lds.h>';   \
309         echo '.section .dtb.init.rodata,"a"';           \
310         echo '.balign STRUCT_ALIGNMENT';                \
311         echo '.global __dtb_$(subst -,_,$(*F))_begin';  \
312         echo '__dtb_$(subst -,_,$(*F))_begin:';         \
313         echo '.incbin "$<" ';                           \
314         echo '__dtb_$(subst -,_,$(*F))_end:';           \
315         echo '.global __dtb_$(subst -,_,$(*F))_end';    \
316         echo '.balign STRUCT_ALIGNMENT';                \
317 } > $@
318
319 $(obj)/%.dtb.S: $(obj)/%.dtb FORCE
320         $(call if_changed,dt_S_dtb)
321
322 quiet_cmd_dtc = DTC     $@
323 cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
324         $(DTC) -O $(patsubst .%,%,$(suffix $@)) -o $@ -b 0 \
325                 $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
326                 -d $(depfile).dtc.tmp $(dtc-tmp) ; \
327         cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
328
329 $(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE
330         $(call if_changed_dep,dtc)
331
332 $(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE
333         $(call if_changed_dep,dtc)
334
335 DT_CHECKER ?= dt-validate
336 DT_BINDING_DIR := Documentation/devicetree/bindings
337 # DT_TMP_SCHEMA may be overridden from Documentation/devicetree/bindings/Makefile
338 DT_TMP_SCHEMA ?= $(objtree)/$(DT_BINDING_DIR)/processed-schema.json
339
340 quiet_cmd_dtb_check =   CHECK   $@
341       cmd_dtb_check =   $(DT_CHECKER) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@
342
343 define rule_dtc
344         $(call cmd_and_fixdep,dtc)
345         $(call cmd,dtb_check)
346 endef
347
348 $(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
349         $(call if_changed_rule,dtc,yaml)
350
351 dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
352
353 # Bzip2
354 # ---------------------------------------------------------------------------
355
356 # Bzip2 and LZMA do not include size in file... so we have to fake that;
357 # append the size as a 32-bit littleendian number as gzip does.
358 size_append = printf $(shell                                            \
359 dec_size=0;                                                             \
360 for F in $(real-prereqs); do                                    \
361         fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F);  \
362         dec_size=$$(expr $$dec_size + $$fsize);                         \
363 done;                                                                   \
364 printf "%08x\n" $$dec_size |                                            \
365         sed 's/\(..\)/\1 /g' | {                                        \
366                 read ch0 ch1 ch2 ch3;                                   \
367                 for ch in $$ch3 $$ch2 $$ch1 $$ch0; do                   \
368                         printf '%s%03o' '\\' $$((0x$$ch));              \
369                 done;                                                   \
370         }                                                               \
371 )
372
373 quiet_cmd_bzip2 = BZIP2   $@
374       cmd_bzip2 = { cat $(real-prereqs) | $(KBZIP2) -9; $(size_append); } > $@
375
376 # Lzma
377 # ---------------------------------------------------------------------------
378
379 quiet_cmd_lzma = LZMA    $@
380       cmd_lzma = { cat $(real-prereqs) | $(LZMA) -9; $(size_append); } > $@
381
382 quiet_cmd_lzo = LZO     $@
383       cmd_lzo = { cat $(real-prereqs) | $(KLZOP) -9; $(size_append); } > $@
384
385 quiet_cmd_lz4 = LZ4     $@
386       cmd_lz4 = { cat $(real-prereqs) | $(LZ4) -l -c1 stdin stdout; \
387                   $(size_append); } > $@
388
389 # U-Boot mkimage
390 # ---------------------------------------------------------------------------
391
392 MKIMAGE := $(srctree)/scripts/mkuboot.sh
393
394 # SRCARCH just happens to match slightly more than ARCH (on sparc), so reduces
395 # the number of overrides in arch makefiles
396 UIMAGE_ARCH ?= $(SRCARCH)
397 UIMAGE_COMPRESSION ?= $(if $(2),$(2),none)
398 UIMAGE_OPTS-y ?=
399 UIMAGE_TYPE ?= kernel
400 UIMAGE_LOADADDR ?= arch_must_set_this
401 UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR)
402 UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)'
403
404 quiet_cmd_uimage = UIMAGE  $@
405       cmd_uimage = $(BASH) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \
406                         -C $(UIMAGE_COMPRESSION) $(UIMAGE_OPTS-y) \
407                         -T $(UIMAGE_TYPE) \
408                         -a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \
409                         -n $(UIMAGE_NAME) -d $< $@
410
411 # XZ
412 # ---------------------------------------------------------------------------
413 # Use xzkern to compress the kernel image and xzmisc to compress other things.
414 #
415 # xzkern uses a big LZMA2 dictionary since it doesn't increase memory usage
416 # of the kernel decompressor. A BCJ filter is used if it is available for
417 # the target architecture. xzkern also appends uncompressed size of the data
418 # using size_append. The .xz format has the size information available at
419 # the end of the file too, but it's in more complex format and it's good to
420 # avoid changing the part of the boot code that reads the uncompressed size.
421 # Note that the bytes added by size_append will make the xz tool think that
422 # the file is corrupt. This is expected.
423 #
424 # xzmisc doesn't use size_append, so it can be used to create normal .xz
425 # files. xzmisc uses smaller LZMA2 dictionary than xzkern, because a very
426 # big dictionary would increase the memory usage too much in the multi-call
427 # decompression mode. A BCJ filter isn't used either.
428 quiet_cmd_xzkern = XZKERN  $@
429       cmd_xzkern = { cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh; \
430                      $(size_append); } > $@
431
432 quiet_cmd_xzmisc = XZMISC  $@
433       cmd_xzmisc = cat $(real-prereqs) | $(XZ) --check=crc32 --lzma2=dict=1MiB > $@
434
435 # ZSTD
436 # ---------------------------------------------------------------------------
437 # Appends the uncompressed size of the data using size_append. The .zst
438 # format has the size information available at the beginning of the file too,
439 # but it's in a more complex format and it's good to avoid changing the part
440 # of the boot code that reads the uncompressed size.
441 #
442 # Note that the bytes added by size_append will make the zstd tool think that
443 # the file is corrupt. This is expected.
444 #
445 # zstd uses a maximum window size of 8 MB. zstd22 uses a maximum window size of
446 # 128 MB. zstd22 is used for kernel compression because it is decompressed in a
447 # single pass, so zstd doesn't need to allocate a window buffer. When streaming
448 # decompression is used, like initramfs decompression, zstd22 should likely not
449 # be used because it would require zstd to allocate a 128 MB buffer.
450
451 quiet_cmd_zstd = ZSTD    $@
452       cmd_zstd = { cat $(real-prereqs) | $(ZSTD) -19; $(size_append); } > $@
453
454 quiet_cmd_zstd22 = ZSTD22  $@
455       cmd_zstd22 = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@
456
457 # ASM offsets
458 # ---------------------------------------------------------------------------
459
460 # Default sed regexp - multiline due to syntax constraints
461 #
462 # Use [:space:] because LLVM's integrated assembler inserts <tab> around
463 # the .ascii directive whereas GCC keeps the <space> as-is.
464 define sed-offsets
465         's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; \
466         /^->/{s:->#\(.*\):/* \1 */:; \
467         s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
468         s:->::; p;}'
469 endef
470
471 # Use filechk to avoid rebuilds when a header changes, but the resulting file
472 # does not
473 define filechk_offsets
474          echo "#ifndef $2"; \
475          echo "#define $2"; \
476          echo "/*"; \
477          echo " * DO NOT MODIFY."; \
478          echo " *"; \
479          echo " * This file was generated by Kbuild"; \
480          echo " */"; \
481          echo ""; \
482          sed -ne $(sed-offsets) < $<; \
483          echo ""; \
484          echo "#endif"
485 endef