From 548e2ea57cf0fe17e79d14e2f31996da2ee256a3 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 7 Sep 2008 16:09:21 +0000 Subject: [PATCH] 2008-09-07 Robert Millan * conf/i386.rmk: New file. Provides declaration for building `cpuid.mod'. * conf/i386-pc.rmk (pkglib_MODULES): Remove `cpuid.mod'. (cpuid_mod_SOURCES, cpuid_mod_CFLAGS, cpuid_mod_LDFLAGS): Remove variables. Include `conf/i386.mk'. * conf/i386-efi.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. * conf/i386-coreboot.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. --- ChangeLog | 13 +++++++++ conf/i386-coreboot.mk | 60 ++--------------------------------------- conf/i386-coreboot.rmk | 8 ++---- conf/i386-efi.mk | 60 ++--------------------------------------- conf/i386-efi.rmk | 8 ++---- conf/i386-ieee1275.mk | 60 ++--------------------------------------- conf/i386-ieee1275.rmk | 8 ++---- conf/i386-pc.mk | 60 ++--------------------------------------- conf/i386-pc.rmk | 8 ++---- conf/i386.mk | 61 ++++++++++++++++++++++++++++++++++++++++++ conf/i386.rmk | 8 ++++++ conf/x86_64-efi.mk | 60 ++--------------------------------------- conf/x86_64-efi.rmk | 8 ++---- 13 files changed, 102 insertions(+), 320 deletions(-) create mode 100644 conf/i386.mk create mode 100644 conf/i386.rmk diff --git a/ChangeLog b/ChangeLog index 22626adf3..41aa04ae8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-09-07 Robert Millan + + * conf/i386.rmk: New file. Provides declaration for building + `cpuid.mod'. + * conf/i386-pc.rmk (pkglib_MODULES): Remove `cpuid.mod'. + (cpuid_mod_SOURCES, cpuid_mod_CFLAGS, cpuid_mod_LDFLAGS): Remove + variables. + Include `conf/i386.mk'. + * conf/i386-efi.rmk: Likewise. + * conf/x86_64-efi.rmk: Likewise. + * conf/i386-coreboot.rmk: Likewise. + * conf/i386-ieee1275.rmk: Likewise. + 2008-09-07 Vesa Jääskeläinen Based on patch created by Colin D Bennett . diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 3e857f5eb..4ffbfb4f7 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -573,7 +573,7 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ - play.mod cpuid.mod serial.mod ata.mod \ + play.mod serial.mod ata.mod \ memdisk.mod pci.mod lspci.mod reboot.mod \ halt.mod datetime.mod date.mod datehook.mod @@ -1516,63 +1516,6 @@ partmap-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i play_mod_CFLAGS = $(COMMON_CFLAGS) play_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst -ifneq ($(cpuid_mod_EXPORTS),no) -CLEANFILES += def-cpuid.lst -DEFSYMFILES += def-cpuid.lst -endif -MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d -UNDSYMFILES += und-cpuid.lst - -cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o - -mod-cpuid.o: mod-cpuid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< - -mod-cpuid.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cpuid_mod_EXPORTS),no) -def-cpuid.lst: pre-cpuid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ -endif - -und-cpuid.lst: pre-cpuid.o - echo 'cpuid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< --include cpuid_mod-commands_i386_cpuid.d - -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst -COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst -FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst - -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) - -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) - -partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) - - -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For ata.mod. ata_mod_SOURCES = disk/ata.c CLEANFILES += ata.mod mod-ata.o mod-ata.c pre-ata.o ata_mod-disk_ata.o und-ata.lst @@ -1991,4 +1934,5 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 3f57d41d3..ac3091277 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -94,7 +94,7 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ - play.mod cpuid.mod serial.mod ata.mod \ + play.mod serial.mod ata.mod \ memdisk.mod pci.mod lspci.mod reboot.mod \ halt.mod datetime.mod date.mod datehook.mod @@ -156,11 +156,6 @@ play_mod_SOURCES = commands/i386/pc/play.c play_mod_CFLAGS = $(COMMON_CFLAGS) play_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For ata.mod. ata_mod_SOURCES = disk/ata.c ata_mod_CFLAGS = $(COMMON_CFLAGS) @@ -196,4 +191,5 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index bf654fe19..286ec54f5 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -119,7 +119,7 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - _linux.mod linux.mod cpuid.mod halt.mod reboot.mod pci.mod lspci.mod \ + _linux.mod linux.mod halt.mod reboot.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod # For kernel.mod. @@ -1349,63 +1349,6 @@ partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst -ifneq ($(cpuid_mod_EXPORTS),no) -CLEANFILES += def-cpuid.lst -DEFSYMFILES += def-cpuid.lst -endif -MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d -UNDSYMFILES += und-cpuid.lst - -cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o - -mod-cpuid.o: mod-cpuid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< - -mod-cpuid.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cpuid_mod_EXPORTS),no) -def-cpuid.lst: pre-cpuid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ -endif - -und-cpuid.lst: pre-cpuid.o - echo 'cpuid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< --include cpuid_mod-commands_i386_cpuid.d - -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst -COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst -FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst - -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) - -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) - -partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) - - -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For halt.mod. halt_mod_SOURCES = commands/halt.c CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst @@ -1824,4 +1767,5 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index d0a216bd6..3259f0ff3 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -76,7 +76,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - _linux.mod linux.mod cpuid.mod halt.mod reboot.mod pci.mod lspci.mod \ + _linux.mod linux.mod halt.mod reboot.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod # For kernel.mod. @@ -144,11 +144,6 @@ linux_mod_SOURCES = loader/linux_normal.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For halt.mod. halt_mod_SOURCES = commands/halt.c halt_mod_CFLAGS = $(COMMON_CFLAGS) @@ -184,4 +179,5 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 0f3c1648a..e24915c73 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -589,7 +589,7 @@ grub-install: util/ieee1275/grub-install.in $(util/ieee1275/grub-install.in_DEPE # Modules. -pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ +pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ date.mod datehook.mod @@ -1304,63 +1304,6 @@ partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCI halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst -ifneq ($(cpuid_mod_EXPORTS),no) -CLEANFILES += def-cpuid.lst -DEFSYMFILES += def-cpuid.lst -endif -MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d -UNDSYMFILES += und-cpuid.lst - -cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o - -mod-cpuid.o: mod-cpuid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< - -mod-cpuid.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cpuid_mod_EXPORTS),no) -def-cpuid.lst: pre-cpuid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ -endif - -und-cpuid.lst: pre-cpuid.o - echo 'cpuid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< --include cpuid_mod-commands_i386_cpuid.d - -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst -COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst -FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst - -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) - -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) - -partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) - - -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For serial.mod. serial_mod_SOURCES = term/i386/pc/serial.c CLEANFILES += serial.mod mod-serial.o mod-serial.c pre-serial.o serial_mod-term_i386_pc_serial.o und-serial.lst @@ -1950,4 +1893,5 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 24cd719f2..79cfd47eb 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -96,7 +96,7 @@ sbin_SCRIPTS = grub-install grub_install_SOURCES = util/ieee1275/grub-install.in # Modules. -pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ +pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ date.mod datehook.mod @@ -143,11 +143,6 @@ halt_mod_SOURCES = commands/halt.c halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For serial.mod. serial_mod_SOURCES = term/i386/pc/serial.c serial_mod_CFLAGS = $(COMMON_CFLAGS) @@ -198,4 +193,5 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 169ca74ac..71d273e68 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -928,7 +928,7 @@ grub-mkrescue: util/i386/pc/grub-mkrescue.in $(util/i386/pc/grub-mkrescue.in_DEP pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ - videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ + videotest.mod play.mod bitmap.mod tga.mod serial.mod \ ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod @@ -2463,63 +2463,6 @@ partmap-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c tga_mod_CFLAGS = $(COMMON_CFLAGS) tga_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst -ifneq ($(cpuid_mod_EXPORTS),no) -CLEANFILES += def-cpuid.lst -DEFSYMFILES += def-cpuid.lst -endif -MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d -UNDSYMFILES += und-cpuid.lst - -cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o - -mod-cpuid.o: mod-cpuid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< - -mod-cpuid.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cpuid_mod_EXPORTS),no) -def-cpuid.lst: pre-cpuid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ -endif - -und-cpuid.lst: pre-cpuid.o - echo 'cpuid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< --include cpuid_mod-commands_i386_cpuid.d - -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst -COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst -FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst - -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) - -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) - -partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) - - -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For ata.mod. ata_mod_SOURCES = disk/ata.c CLEANFILES += ata.mod mod-ata.o mod-ata.c pre-ata.o ata_mod-disk_ata.o und-ata.lst @@ -3394,4 +3337,5 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index fc36a6ea2..1c2447a2c 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -163,7 +163,7 @@ grub_mkrescue_SOURCES = util/i386/pc/grub-mkrescue.in pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ - videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ + videotest.mod play.mod bitmap.mod tga.mod serial.mod \ ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod @@ -278,11 +278,6 @@ tga_mod_SOURCES = video/readers/tga.c tga_mod_CFLAGS = $(COMMON_CFLAGS) tga_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For ata.mod. ata_mod_SOURCES = disk/ata.c ata_mod_CFLAGS = $(COMMON_CFLAGS) @@ -358,4 +353,5 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386.mk b/conf/i386.mk new file mode 100644 index 000000000..77616d1cc --- /dev/null +++ b/conf/i386.mk @@ -0,0 +1,61 @@ +# -*- makefile -*- +# Generated by genmk.rb, please don't edit! + +pkglib_MODULES += cpuid.mod + +# For cpuid.mod. +cpuid_mod_SOURCES = commands/i386/cpuid.c +CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst +ifneq ($(cpuid_mod_EXPORTS),no) +CLEANFILES += def-cpuid.lst +DEFSYMFILES += def-cpuid.lst +endif +MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d +UNDSYMFILES += und-cpuid.lst + +cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o + -rm -f $@ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o + +mod-cpuid.o: mod-cpuid.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< + +mod-cpuid.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(cpuid_mod_EXPORTS),no) +def-cpuid.lst: pre-cpuid.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ +endif + +und-cpuid.lst: pre-cpuid.o + echo 'cpuid' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) + $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< +-include cpuid_mod-commands_i386_cpuid.d + +CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst +COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst +FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst +PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst + +cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) + +fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) + +partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) + + +cpuid_mod_CFLAGS = $(COMMON_CFLAGS) +cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386.rmk b/conf/i386.rmk new file mode 100644 index 000000000..458415b08 --- /dev/null +++ b/conf/i386.rmk @@ -0,0 +1,8 @@ +# -*- makefile -*- + +pkglib_MODULES += cpuid.mod + +# For cpuid.mod. +cpuid_mod_SOURCES = commands/i386/cpuid.c +cpuid_mod_CFLAGS = $(COMMON_CFLAGS) +cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index bd0a4e1d5..d0e0811fc 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -103,7 +103,7 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - cpuid.mod halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \ + halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod # For kernel.mod. @@ -1352,63 +1352,6 @@ partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst -ifneq ($(cpuid_mod_EXPORTS),no) -CLEANFILES += def-cpuid.lst -DEFSYMFILES += def-cpuid.lst -endif -MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d -UNDSYMFILES += und-cpuid.lst - -cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o - -mod-cpuid.o: mod-cpuid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< - -mod-cpuid.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cpuid_mod_EXPORTS),no) -def-cpuid.lst: pre-cpuid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ -endif - -und-cpuid.lst: pre-cpuid.o - echo 'cpuid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< --include cpuid_mod-commands_i386_cpuid.d - -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst -COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst -FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst - -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) - -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) - -partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) - - -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For halt.mod. halt_mod_SOURCES = commands/halt.c CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst @@ -1827,4 +1770,5 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 16008522d..6d13981bf 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -78,7 +78,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - cpuid.mod halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \ + halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod # For kernel.mod. @@ -146,11 +146,6 @@ linux_mod_SOURCES = loader/linux_normal.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For halt.mod. halt_mod_SOURCES = commands/halt.c halt_mod_CFLAGS = $(COMMON_CFLAGS) @@ -186,4 +181,5 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk