Back to home page

Quest Cross Reference

 
 

    


0001  (OPT) $(CFG) $(EXTRA_CFLAGS)
0002 CPPFLAGS = -D_QUEST -Wa,--32 -MMD -I (OPT) -D_ATS_PRELUDE_NONE -D_ATS_DYNLOADFUN_NONE -D_ATS_STALOADFUN_NONE -DATS_TYPES_H -DATS_EXCEPTION_H -DATS_MEMORY_H -D_QUEST
0003 INDENT = indent
0004 INDENTFLAGS = -gnu -br -ce --no-tabs
0005 
0006 ##################################################
0007 
0008 MNT_POINT=/mnt/quest
0009 PROGS = quest \
0010         sysprogs/shell sysprogs/spinner sysprogs/iotest sysprogs/ipctest \
0011         tests/exec tests/race tests/test1 tests/test2 \
0012         tests/test3 tests/test4 tests/test5 tests/test6 tests/test7
0013 
0014 ##################################################
0015 
0016 OBJS =  boot/boot.o boot/init.o kernel.o module/loader.o \
0017         interrupt.o interrupt_handler.o \
0018         smp/boot-smp.o smp/smp.o smp/intel.o smp/acpi.o smp/apic.o smp/semaphore.o \
0019         arch/i386/percpu.o arch/i386/measure.o \
0020         vm/vmx.o vm/vm86.o vm/code16.o \
0021         sched/task.o sched/sched.o sched/sleep.o sched/vcpu.o sched/ipc.o \
0022         mem/physical.o mem/virtual.o mem/pow2.o \
0023         util/cpuid.o util/printf.o util/screen.o util/debug.o util/circular.o \
0024         util/crc32.o util/bitrev.o util/logger.o util/perfmon.o \
0025         drivers/ata/ata.o drivers/ata/diskio.o \
0026         drivers/input/keyboard_8042.o drivers/input/keymap.o \
0027         drivers/pci/pci.o drivers/pci/pci_irq.o \
0028         drivers/net/ethernetif.o drivers/net/pcnet.o \
0029         drivers/net/e1000.o drivers/net/e1000e.o \
0030         drivers/net/bnx2.o drivers/net/r8169.o \
0031         drivers/net/mac80211.o drivers/net/netsetup.o \
0032         drivers/serial/mcs9922.o \
0033         fs/fsys.o \
0034         fs/ext2/fsys_ext2fs.o \
0035         fs/iso9660/fsys_iso9660.o \
0036         fs/vfat/fsys_vfat.o \
0037         fs/tftp/fsys_tftp.o \
0038         drivers/sb16/sound.o \
0039         drivers/acpi/quest-acpica.o \
0040         drivers/eeprom/93cx6.o \
0041         drivers/usb/uhci_hcd.o drivers/usb/uvc.o drivers/usb/umsc.o \
0042         drivers/usb/hub.o drivers/usb/net.o drivers/usb/asix.o \
0043         drivers/usb/ftdi.o drivers/usb/pl2303.o \
0044         drivers/usb/rtl8187b.o \
0045         drivers/usb/usb_tests.o \
0046         drivers/usb/usb.o drivers/usb/enumeration.o \
0047         kdb/i386-stub.o
0048 
0049 CFILES = $(patsubst %.o,%.c,$(OBJS))
0050 DFILES = $(patsubst %.o,%.d,$(OBJS))
0051 MAPFILES = $(patsubst %.o,%.map,$(OBJS))
0052 
0053 ##################################################
0054 
0055 ACPI_SRCS = $(shell ls drivers/acpica/*.c)
0056 ACPI_OBJS = $(patsubst %.c,%.o,$(ACPI_SRCS))
0057 ACPI_DEPS = $(patsubst %.c,%.d,$(ACPI_SRCS))
0058 
0059 ##################################################
0060 
0061 LIBLWIP = lwip.a
0062 
0063 LWIP_CFILES = \
0064   lwip/api/netbuf.c \
0065   lwip/api/api_msg.c \
0066   lwip/api/tcpip.c \
0067   lwip/api/sockets.c \
0068   lwip/api/netdb.c \
0069   lwip/api/netifapi.c \
0070   lwip/api/err.c \
0071   lwip/api/api_lib.c \
0072   lwip/core/dhcp.c \
0073   lwip/core/tcp_in.c \
0074   lwip/core/pbuf.c \
0075   lwip/core/netif.c \
0076   lwip/core/tcp.c \
0077   lwip/core/dns.c \
0078   lwip/core/stats.c \
0079   lwip/core/tcp_out.c \
0080   lwip/core/raw.c \
0081   lwip/core/sys.c \
0082   lwip/core/mem.c \
0083   lwip/core/ipv4/inet.c \
0084   lwip/core/ipv4/ip.c \
0085   lwip/core/ipv4/icmp.c \
0086   lwip/core/ipv4/ip_addr.c \
0087   lwip/core/ipv4/igmp.c \
0088   lwip/core/ipv4/autoip.c \
0089   lwip/core/ipv4/ip_frag.c \
0090   lwip/core/ipv4/inet_chksum.c \
0091   lwip/core/init.c \
0092   lwip/core/memp.c \
0093   lwip/core/udp.c \
0094   lwip/netif/ethernetif.c \
0095   lwip/netif/slipif.c \
0096   lwip/netif/loopif.c \
0097   lwip/netif/etharp.c
0098 
0099 LWIP_OBJS = $(patsubst %.c,%.o,$(LWIP_CFILES))
0100 LWIP_DEPS = $(patsubst %.c,%.d,$(LWIP_CFILES))
0101 
0102 ##################################################
0103 
0104 .PHONY: all tags clean cleanacpi cleanlwip vmware cleanall indent netboot
0105 
0106 all: $(PROGS)
0107 
0108 quest: $(OBJS) $(ACPI_OBJS) $(LWIP_OBJS)
0109         rm -f quest
0110         $(LD) -Map quest.map -T ldscripts/quest.ld -o $@ $^ 
0111 
0112 %: %.o
0113         $(LD) -o $@ $< -T ldscripts/module.ld -Map $@.map
0114 
0115 %: %.c
0116 
0117 %.o: %.dats
0118         $(ATSCC) $(ATSFLAGS) -fno-builtin -m32 -o $@ -c $^
0119 
0120 install: $(PROGS)
0121         cp $(PROGS) welcome.raw $(MNT_POINT)/boot
0122         sync
0123 
0124 vmware: install quest.iso
0125         qemu-img convert c.img -O vmdk c-img.vmdk
0126         cp c-img.vmdk /mnt/hgfs/shared/quest/
0127         cp quest.iso /mnt/hgfs/shared/quest/
0128 
0129 quest.iso: quest $(PROGS) iso-grub.cfg
0130         mkdir -p iso/boot/grub 
0131         cp iso-grub.cfg iso/boot/grub/grub.cfg
0132         cp $(GRUB2)/eltorito.img iso/boot/grub/
0133         $(TAR) -C iso/boot/grub -jxf $(GRUB2)/mods.tar.bz2
0134         cp $(PROGS) welcome.raw iso/boot/ 
0135         mkisofs -quiet $(MSINFO) \
0136                 -R -b boot/grub/eltorito.img \
0137                 -no-emul-boot -boot-load-size 4 \
0138                 -boot-info-table -o $@ iso
0139 
0140 indent:
0141         (for f in $(CFILES); do [ -f "$$f" ] && $(INDENT) $(INDENTFLAGS) "$$f"; done)
0142 
0143 tags:
0144         find . -name '*.[ch]' | xargs etags -o TAGS 
0145         find . -name '*.[ch]' | xargs ctags -o tags
0146 
0147 clean:
0148         -rm -f $(OBJS) $(DFILES) $(MAPFILES) $(PROGS) quest.iso quest.map
0149         -rm -rf iso tftp
0150 
0151 cleanacpi:
0152         -rm -f $(ACPI_OBJS) $(ACPI_DEPS)
0153 
0154 cleanall: clean cleanacpi cleanlwip
0155 
0156 define ACPI_template
0157 $(1): $(patsubst %.o,%.c,$(1))
0158         $(CC) $(CFLAGS) $(CPPFLAGS) -o $$@ -c $$^
0159 endef
0160 
0161 $(foreach obj,$(ACPI_OBJS),$(eval $(call ACPI_template,$(obj))))
0162 
0163 netboot: quest.iso
0164         mkdir -p $(TFTPDIR)/boot/grub
0165         cp quest sysprogs/shell $(TFTPDIR)/boot
0166         cp netboot/grub.cfg $(TFTPDIR)/boot/grub
0167         cp $(GRUB2)/grub2pxe $(TFTPDIR)
0168         $(TAR) -C $(TFTPDIR)/boot/grub -jxf $(GRUB2)/mods.tar.bz2
0169 
0170 ##################################################
0171 # LWIP
0172 
0173 $(LIBLWIP): $(LWIP_OBJS)
0174         $(AR) r $@ $(LWIP_OBJS)
0175         ranlib $@
0176 
0177 cleanlwip:
0178         -rm -f $(LWIP_OBJS) $(LWIP_DEPS) $(LIBLWIP)
0179 
0180 ##################################################
0181 
0182 config.mk: default-config.mk
0183         cp -f default-config.mk config.mk
0184 
0185 #-include $(shell find . -name '*.d')