# Makefile for ominOS .EXPORT_ALL_VARIABLES: TOPDIR:=$(shell pwd) include tools/defconfig COMPILEID = $(shell whoami)@$(shell hostname) $(shell date '+%Y-%m-%d %T %Z') # Directories KERNEL = $(TOPDIR)/kernel LIB = $(TOPDIR)/lib DRIVERS = $(TOPDIR)/drivers MM = $(TOPDIR)/mm ARCH = $(TOPDIR)/arch BOOT = $(TOPDIR)/boot INCLUDE = $(TOPDIR)/include MENU_CONFIG = $(TOPDIR)/tools/lxdialog # program files CC = gcc-3.4 LD = ld NASM = nasm RM = rm ifeq "$(CONFIG_GENERAL_SILENT)" "y" MAKE = make -s else MAKE = make endif # flags DEBUG = CFLAGS = -g -Wall -Winline -ffreestanding -nostdinc -nostdlib -fno-strict-aliasing -m32 -DCOMPILE_ID='"${COMPILEID}"' -I$(INCLUDE) $(DEBUG) LD_MBLOAD_FLAGS = -static -nostdlib -Tmbloader.ld LD_KERNEL_FLAGS = -static -nostdlib -Tkernel.ld KERNEL32_TARGET = kernel32 MULTIBOOT_TARGET = nucleus SUBDIRS = boot arch kernel mm omlib drivers default: all nucleus kernel32 clean noclean: all nucleus kernel32 all: cd include; ln -sf i386 arch @for dir in $(SUBDIRS);\ do ( $(MAKE) -C $$dir all);\ done nucleus: boot.o multiboot.o cpu.o memInit.o page.o string.o nucleus: debug.o doprint.o emit_str.o ld $(LD_MBLOAD_FLAGS) $^ -o $@ kernel32: kernel.o cpu.o debug.o doprint.o emit_str.o string.o kstrdup.o kernel32: idt.o idt-stub.o pic.o gdt.o memInit.o page.o mm.o dma.o kernel32: manager.o null.o text.o tty.o timer.o process.o arch_process.o kernel32: mutex.o arch_systemcall.o systemcall.o floppy.o fat.o vfs.o rootfs.o kernel32: devfs.o io.o ld $(LD_KERNEL_FLAGS) $^ -o $@ config: $(MAKE) -C $(MENU_CONFIG) all ./config.sh clean: @echo -n Cleaning up... @$(RM) *.o @for dir in $(SUBDIRS);\ do ( $(MAKE) -C $$dir distclean);\ done @echo done fdimage: mount floppy cp nucleus floppy/system/. cp kernel32 floppy/system/. umount floppy wc: @wc -l `find . -type f` include buildrules.inc