diff --git a/ChangeLog b/ChangeLog index 728ef1a47..ae6ee252e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2005-11-07 Marco Gerards + + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add + `commands/test.c', `normal/execute.c', `normal/lexer.c', + `grub_script.tab.c', `normal/function.c' and `normal/script.c'. + (normal_mod_SOURCES): `normal/execute.c', `normal/lexer.c', + `grub_script.tab.c', `normal/function.c' and `normal/script.c'. + (test_mod_SOURCES): New variable. + (test_mod_CFLAGS): Likewise. + (pkgdata_MODULES): Add `test.mod'. + (grub_script.tab.c): New rule. + (grub_script.tab.h): Likewise. + 2005-11-06 Marco Gerards Add initial scripting support. @@ -17,7 +30,8 @@ `normal/function.c' and `normal/script.c'. (normal_mod_SOURCES): `normal/execute.c', `normal/lexer.c', `grub_script.tab.c', `normal/function.c' and `normal/script.c'. - (test_mod_SOURCES, test_mod_CFLAGS, test_mod_LDFLAGS): New variables. + (test_mod_SOURCES, test_mod_CFLAGS, test_mod_LDFLAGS): New + variables. (pkgdata_MODULES): Add `test.mod'. (grub_script.tab.c): New rule. (grub_script.tab.h): Likewise. diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 6c410bed0..c6396a452 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -21,6 +21,12 @@ grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) genkernsyms.sh sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@ +# For the parser. +grub_script.tab.c: normal/parser.y + $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y +grub_script.tab.h: normal/parser.y + $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y + # Programs pkgdata_PROGRAMS = grubof @@ -66,8 +72,8 @@ grub_mkimage-util_resolve.d: util/resolve.c # For grub-emu grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/default.c commands/help.c \ - commands/search.c commands/terminal.c commands/ls.c \ - commands/timeout.c \ + commands/search.c commands/terminal.c commands/test.c \ + commands/ls.c commands/timeout.c \ commands/ieee1275/halt.c commands/ieee1275/reboot.c \ disk/loopback.c \ fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ @@ -77,16 +83,17 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ kern/parser.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c \ - normal/main.c normal/menu.c normal/menu_entry.c normal/misc.c \ + normal/completion.c normal/context.c normal/execute.c \ + normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_entry.c normal/misc.c normal/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ util/console.c util/grub-emu.c util/misc.c \ util/i386/pc/biosdisk.c util/i386/pc/getroot.c \ - util/powerpc/ieee1275/misc.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_default.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_timeout.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_context.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_powerpc_ieee1275_misc.d + util/powerpc/ieee1275/misc.c grub_script.tab.c +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_default.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_timeout.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_context.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-grub_script_tab.d -grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o +grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c @@ -153,6 +160,14 @@ grub_emu-commands_terminal.d: commands/terminal.c -include grub_emu-commands_terminal.d +grub_emu-commands_test.o: commands/test.c + $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< + +grub_emu-commands_test.d: commands/test.c + set -e; $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,test\.o[ :]*,grub_emu-commands_test.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_emu-commands_test.d + grub_emu-commands_ls.o: commands/ls.c $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< @@ -441,6 +456,30 @@ grub_emu-normal_context.d: normal/context.c -include grub_emu-normal_context.d +grub_emu-normal_execute.o: normal/execute.c + $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< + +grub_emu-normal_execute.d: normal/execute.c + set -e; $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,execute\.o[ :]*,grub_emu-normal_execute.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_emu-normal_execute.d + +grub_emu-normal_function.o: normal/function.c + $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< + +grub_emu-normal_function.d: normal/function.c + set -e; $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,function\.o[ :]*,grub_emu-normal_function.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_emu-normal_function.d + +grub_emu-normal_lexer.o: normal/lexer.c + $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< + +grub_emu-normal_lexer.d: normal/lexer.c + set -e; $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,lexer\.o[ :]*,grub_emu-normal_lexer.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_emu-normal_lexer.d + grub_emu-normal_main.o: normal/main.c $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< @@ -473,6 +512,14 @@ grub_emu-normal_misc.d: normal/misc.c -include grub_emu-normal_misc.d +grub_emu-normal_script.o: normal/script.c + $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< + +grub_emu-normal_script.d: normal/script.c + set -e; $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,script\.o[ :]*,grub_emu-normal_script.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_emu-normal_script.d + grub_emu-partmap_amiga.o: partmap/amiga.c $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< @@ -553,6 +600,14 @@ grub_emu-util_powerpc_ieee1275_misc.d: util/powerpc/ieee1275/misc.c -include grub_emu-util_powerpc_ieee1275_misc.d +grub_emu-grub_script_tab.o: grub_script.tab.c + $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< + +grub_emu-grub_script_tab.d: grub_script.tab.c + set -e; $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,grub_script\.tab\.o[ :]*,grub_emu-grub_script_tab.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_emu-grub_script_tab.d + grub_emu_LDFLAGS = $(LIBCURSES) @@ -810,7 +865,7 @@ pkgdata_MODULES = _linux.mod linux.mod fat.mod ufs.mod ext2.mod minix.mod \ boot.mod cmp.mod cat.mod terminal.mod fshelp.mod amiga.mod apple.mod \ pc.mod suspend.mod loopback.mod help.mod reboot.mod halt.mod sun.mod \ default.mod timeout.mod configfile.mod search.mod gzio.mod xfs.mod \ - affs.mod sfs.mod + affs.mod sfs.mod test.mod # For fshelp.mod. fshelp_mod_SOURCES = fs/fshelp.c @@ -1418,11 +1473,12 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS) # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c normal/main.c \ - normal/menu.c normal/menu_entry.c normal/misc.c \ - normal/powerpc/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_powerpc_setjmp.o def-normal.lst und-normal.lst -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_context.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-normal_powerpc_setjmp.d + normal/completion.c normal/context.c normal/execute.c \ + normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_entry.c normal/misc.c grub_script.tab.c \ + normal/script.c normal/powerpc/setjmp.S +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o def-normal.lst und-normal.lst +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_context.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d DEFSYMFILES += def-normal.lst UNDSYMFILES += und-normal.lst @@ -1431,7 +1487,7 @@ normal.mod: pre-normal.o mod-normal.o $(LD) $(normal_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_powerpc_setjmp.o +pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o -rm -f $@ $(LD) $(normal_mod_LDFLAGS) -r -d -o $@ $^ @@ -1543,6 +1599,63 @@ fs-context.lst: normal/context.c genfslist.sh set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_execute.o: normal/execute.c + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< + +normal_mod-normal_execute.d: normal/execute.c + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include normal_mod-normal_execute.d + +CLEANFILES += cmd-execute.lst fs-execute.lst +COMMANDFILES += cmd-execute.lst +FSFILES += fs-execute.lst + +cmd-execute.lst: normal/execute.c gencmdlist.sh + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-execute.lst: normal/execute.c genfslist.sh + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_function.o: normal/function.c + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< + +normal_mod-normal_function.d: normal/function.c + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include normal_mod-normal_function.d + +CLEANFILES += cmd-function.lst fs-function.lst +COMMANDFILES += cmd-function.lst +FSFILES += fs-function.lst + +cmd-function.lst: normal/function.c gencmdlist.sh + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-function.lst: normal/function.c genfslist.sh + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_lexer.o: normal/lexer.c + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< + +normal_mod-normal_lexer.d: normal/lexer.c + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include normal_mod-normal_lexer.d + +CLEANFILES += cmd-lexer.lst fs-lexer.lst +COMMANDFILES += cmd-lexer.lst +FSFILES += fs-lexer.lst + +cmd-lexer.lst: normal/lexer.c gencmdlist.sh + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-lexer.lst: normal/lexer.c genfslist.sh + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_main.o: normal/main.c $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -1619,6 +1732,44 @@ fs-misc.lst: normal/misc.c genfslist.sh set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-grub_script_tab.o: grub_script.tab.c + $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< + +normal_mod-grub_script_tab.d: grub_script.tab.c + set -e; $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include normal_mod-grub_script_tab.d + +CLEANFILES += cmd-grub_script.tab.lst fs-grub_script.tab.lst +COMMANDFILES += cmd-grub_script.tab.lst +FSFILES += fs-grub_script.tab.lst + +cmd-grub_script.tab.lst: grub_script.tab.c gencmdlist.sh + set -e; $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-grub_script.tab.lst: grub_script.tab.c genfslist.sh + set -e; $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_script.o: normal/script.c + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< + +normal_mod-normal_script.d: normal/script.c + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include normal_mod-normal_script.d + +CLEANFILES += cmd-script.lst fs-script.lst +COMMANDFILES += cmd-script.lst +FSFILES += fs-script.lst + +cmd-script.lst: normal/script.c gencmdlist.sh + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-script.lst: normal/script.c genfslist.sh + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_powerpc_setjmp.o: normal/powerpc/setjmp.S $(CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $< @@ -2690,6 +2841,56 @@ fs-gzio.lst: io/gzio.c genfslist.sh gzio_mod_CFLAGS = $(COMMON_CFLAGS) + +# For test.mod. +test_mod_SOURCES = commands/test.c +CLEANFILES += test.mod mod-test.o mod-test.c pre-test.o test_mod-commands_test.o def-test.lst und-test.lst +MOSTLYCLEANFILES += test_mod-commands_test.d +DEFSYMFILES += def-test.lst +UNDSYMFILES += und-test.lst + +test.mod: pre-test.o mod-test.o + -rm -f $@ + $(LD) $(test_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-test.o: test_mod-commands_test.o + -rm -f $@ + $(LD) $(test_mod_LDFLAGS) -r -d -o $@ $^ + +mod-test.o: mod-test.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -c -o $@ $< + +mod-test.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'test' $< > $@ || (rm -f $@; exit 1) + +def-test.lst: pre-test.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 test/' > $@ + +und-test.lst: pre-test.o + echo 'test' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +test_mod-commands_test.o: commands/test.c + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -c -o $@ $< + +test_mod-commands_test.d: commands/test.c + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -M $< | sed 's,test\.o[ :]*,test_mod-commands_test.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include test_mod-commands_test.d + +CLEANFILES += cmd-test.lst fs-test.lst +COMMANDFILES += cmd-test.lst +FSFILES += fs-test.lst + +cmd-test.lst: commands/test.c gencmdlist.sh + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh test > $@ || (rm -f $@; exit 1) + +fs-test.lst: commands/test.c genfslist.sh + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh test > $@ || (rm -f $@; exit 1) + + +test_mod_CFLAGS = $(COMMON_CFLAGS) CLEANFILES += moddep.lst command.lst fs.lst pkgdata_DATA += moddep.lst command.lst fs.lst moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index dfe634393..b02cdee6e 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -21,6 +21,12 @@ grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) genkernsyms.sh sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@ +# For the parser. +grub_script.tab.c: normal/parser.y + $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y +grub_script.tab.h: normal/parser.y + $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y + # Programs pkgdata_PROGRAMS = grubof @@ -36,8 +42,8 @@ grub_mkimage_SOURCES = util/powerpc/ieee1275/grub-mkimage.c util/misc.c \ # For grub-emu grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/default.c commands/help.c \ - commands/search.c commands/terminal.c commands/ls.c \ - commands/timeout.c \ + commands/search.c commands/terminal.c commands/test.c \ + commands/ls.c commands/timeout.c \ commands/ieee1275/halt.c commands/ieee1275/reboot.c \ disk/loopback.c \ fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ @@ -47,12 +53,13 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ kern/parser.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c \ - normal/main.c normal/menu.c normal/menu_entry.c normal/misc.c \ + normal/completion.c normal/context.c normal/execute.c \ + normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_entry.c normal/misc.c normal/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ util/console.c util/grub-emu.c util/misc.c \ util/i386/pc/biosdisk.c util/i386/pc/getroot.c \ - util/powerpc/ieee1275/misc.c + util/powerpc/ieee1275/misc.c grub_script.tab.c grub_emu_LDFLAGS = $(LIBCURSES) @@ -84,7 +91,7 @@ pkgdata_MODULES = _linux.mod linux.mod fat.mod ufs.mod ext2.mod minix.mod \ boot.mod cmp.mod cat.mod terminal.mod fshelp.mod amiga.mod apple.mod \ pc.mod suspend.mod loopback.mod help.mod reboot.mod halt.mod sun.mod \ default.mod timeout.mod configfile.mod search.mod gzio.mod xfs.mod \ - affs.mod sfs.mod + affs.mod sfs.mod test.mod # For fshelp.mod. fshelp_mod_SOURCES = fs/fshelp.c @@ -140,9 +147,10 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS) # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c normal/main.c \ - normal/menu.c normal/menu_entry.c normal/misc.c \ - normal/powerpc/setjmp.S + normal/completion.c normal/context.c normal/execute.c \ + normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_entry.c normal/misc.c grub_script.tab.c \ + normal/script.c normal/powerpc/setjmp.S normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) @@ -229,3 +237,7 @@ search_mod_CFLAGS = $(COMMON_CFLAGS) # For gzio.mod. gzio_mod_SOURCES = io/gzio.c gzio_mod_CFLAGS = $(COMMON_CFLAGS) + +# For test.mod. +test_mod_SOURCES = commands/test.c +test_mod_CFLAGS = $(COMMON_CFLAGS)