bjm.c \
block.c \
bpf.c \
+ btrfs.c \
cacheflush.c \
capability.c \
caps0.h \
fetch_struct_statfs.c \
file.c \
file_handle.c \
+ file_ioctl.c \
+ fs_x_ioctl.c \
flock.c \
flock.h \
futex.c \
getcpu.c \
getcwd.c \
getrandom.c \
+ hdio.c \
hostname.c \
inotify.c \
io.c \
time.c \
times.c \
truncate.c \
+ ubi.c \
uid.c \
uid16.c \
umask.c \
linux/mips/syscallent.h \
linux/mips/userent.h \
linux/mtd-abi.h \
+ linux/netlink_diag.h \
linux/nios2/arch_regs.c \
linux/nios2/get_error.c \
linux/nios2/get_scno.c \
BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \
native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version
-CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) \
+CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \
native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h
DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h
# defines mpers_source_files
include mpers.am
srcdir_mpers_source_files = $(patsubst %,$(srcdir)/%,$(mpers_source_files))
+mpers_preproc_files = $(mpers_source_files:.c=.c.mpers.i)
mpers_NAME =
mpers_PREFIX = $(mpers_NAME)_
# printers
-printers.h: $(srcdir_mpers_source_files)
+%.c.mpers.i: $(srcdir)/%.c
+ $(CPP) -P $(mpers_sh_opts) -DIN_MPERS_BOOTSTRAP $< -o $@
+
+mpers_printer_decl_pattern = ^MPERS_PRINTER_DECL(\([^,)]\+\),[[:space:]]*\([^,)]\+\),[[:space:]]*\([^)]\+\))$$
+
+printers.h: $(mpers_preproc_files)
echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
echo 'typedef struct {' >> $@-t
for f in $^; do \
- sed -n 's/^MPERS_PRINTER_DECL(\([^,]\+\),[[:space:]]*\([^)]\+\))\(.*\)/ \1 (*\2) \3;\n#define \2 MPERS_PRINTER_NAME(\2)\n/p' $$f || exit; \
+ sed -n 's/$(mpers_printer_decl_pattern)/ \1 (*\2)(\3);\n#define \2 MPERS_PRINTER_NAME(\2)\n/p' $$f \
+ || exit; \
done >> $@-t
echo '} struct_printers;' >> $@-t
echo 'extern const struct_printers *printers;' >> $@-t
echo '#define MPERS_PRINTER_NAME(printer_name) printers->printer_name' >> $@-t
mv $@-t $@
-%_printer_decls.h: $(srcdir_mpers_source_files)
+%_printer_decls.h: $(mpers_preproc_files)
echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
for f in $^; do \
- sed -n 's/^MPERS_PRINTER_DECL(\([^,]\+\),[[:space:]]*\([^)]\+\))\(.*\)/extern \1 $(mpers_PREFIX)\2\3;/p' $$f || exit; \
+ sed -n 's/$(mpers_printer_decl_pattern)/extern \1 $(mpers_PREFIX)\2(\3);/p' $$f \
+ || exit; \
done >> $@-t
mv $@-t $@
-%_printer_defs.h: $(srcdir_mpers_source_files)
+%_printer_defs.h: $(mpers_preproc_files)
echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
for f in $^; do \
- sed -n 's/^MPERS_PRINTER_DECL(\([^,]\+\),[[:space:]]*\([^)]\+\))\(.*\)/\.\2 = $(mpers_PREFIX)\2,/p' $$f || exit; \
+ sed -n 's/$(mpers_printer_decl_pattern)/\.\2 = $(mpers_PREFIX)\2,/p' $$f \
+ || exit; \
done >> $@-t
mv $@-t $@