X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2FMakefile;h=a5a5c03f385cdd0729ca7d869157dc625a038718;hb=700d4228ad14b3a7406eefc9a58735748c254d42;hp=531ab655a0ea52d6e6cbd3e4810ab98c320dd393;hpb=341da8d5cb692850e10b89cf5442ddf3186be07c;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/Makefile b/KernelLand/Kernel/Makefile index 531ab655..a5a5c03f 100644 --- a/KernelLand/Kernel/Makefile +++ b/KernelLand/Kernel/Makefile @@ -24,7 +24,7 @@ endif ASFLAGS += -D ARCHDIR_IS_$(ARCHDIR)=1 -D PLATFORM_is_$(PLATFORM)=1 CPPFLAGS += -I./include -I./arch/$(ARCHDIR)/include -D_MODULE_NAME_=\"Kernel\" CPPFLAGS += -D ARCH=$(ARCH) -D ARCHDIR=$(ARCHDIR) -D PLATFORM=\"$(PLATFORM)\" -D ARCHDIR_IS_$(ARCHDIR)=1 -D PLATFORM_is_$(PLATFORM)=1 -CPPFLAGS += -D KERNEL_VERSION=$(KERNEL_VERSION) +CPPFLAGS += -D KERNEL_VERSION=$(KERNEL_VERSION) -ffreestanding CFLAGS += -Wall -fno-stack-protector -Wstrict-prototypes -g CFLAGS += -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wuninitialized CFLAGS += -O3 @@ -54,7 +54,7 @@ OBJ := $(addprefix arch/$(ARCHDIR)/,$(A_OBJ)) OBJ += heap.o drvutil.o logging.o debug.o lib.o adt.o time.o OBJ += messages.o modules.o syscalls.o system.o OBJ += threads.o mutex.o semaphore.o workqueue.o events.o -OBJ += drv/proc.o drv/fifo.o drv/iocache.o drv/pci.o +OBJ += drv/zero-one.o drv/proc.o drv/fifo.o drv/iocache.o drv/pci.o OBJ += drv/vterm.o drv/vterm_font.o drv/vterm_vt100.o drv/vterm_output.o drv/vterm_input.o drv/vterm_termbuf.o OBJ += binary.o bin/elf.o bin/pe.o OBJ += vfs/main.o vfs/open.o vfs/acls.o vfs/dir.o vfs/io.o vfs/mount.o @@ -82,6 +82,8 @@ clean: @$(RM) $(BIN) ../Acess2.$(ARCH).gz $(BIN).dsm ../Map.$(ARCH).txt LineCounts.$(ARCH).txt @$(RM) -r $(OBJDIR) $(OBJ) $(DEPFILES) $(BUILDINFO_SRC) +# Creates a stripped and compressed copy of the kernel +# and installs it to the target install: $(BIN) @cp $(BIN) $(BIN)_ @$(STRIP) $(BIN)_ @@ -89,9 +91,16 @@ install: $(BIN) @$(RM) $(BIN)_ $(xCP) $(GZBIN) $(DISTROOT) +# Compile API documentation apidoc: doxygen Doxyfile.api +# Output binary +# - Links kernel +# - Disassembles it +# - Gets a line count +# - Increments the build count +# - Does whatever architecture defined rules $(BIN): $(OBJ) $(MODS) arch/$(ARCHDIR)/link.ld Makefile ../../BuildConf/$(ARCH)/Makefile.cfg ../../BuildConf/$(ARCH)/$(PLATFORM).mk @echo --- LD -o $(BIN) @$(LD) $(LDFLAGS) -o $(BIN) $(OBJ) $(MODS) --defsym __buildnum=$$(( $(BUILD_NUM) + 1 )) -Map ../Map.$(ARCH).txt @@ -100,6 +109,7 @@ $(BIN): $(OBJ) $(MODS) arch/$(ARCHDIR)/link.ld Makefile ../../BuildConf/$(ARCH)/ @echo BUILD_NUM = $$(( $(BUILD_NUM) + 1 )) > Makefile.BuildNum.$(ARCH) $(POSTBUILD) +# Assembly Sources $(OBJDIR)%.ao$(OBJSUFFIX): %.$(AS_SUFFIX) Makefile @echo --- AS -o $@ @mkdir -p $(dir $@) @@ -108,28 +118,30 @@ ifeq ($(AS_SUFFIX),S) @$(MAKEDEP) $(CPPFLAGS) -MT $@ -o $(OBJDIR)$*.ao.dep$(OBJSUFFIX) $< endif +# C Sources $(OBJDIR)%.o$(OBJSUFFIX): %.c Makefile -# if exists %*/Makefile -# @make -C %*/ all -# else @echo --- CC -o $@ @mkdir -p $(dir $@) @$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< @$(MAKEDEP) $(CPPFLAGS) -MT $@ -o $(OBJDIR)$*.o.dep$(OBJSUFFIX) $< -# endif +# Build-time linked modules %.xo.$(ARCH): @BUILDTYPE=static make -C $* all +# System call lists include/syscalls.h include/syscalls.inc.asm: syscalls.lst Makefile GenSyscalls.pl perl GenSyscalls.pl -Makefile: ../Makefile.cfg arch/$(ARCHDIR)/Makefile +# Rules based on the makefile +Makefile: ../../Makefile.cfg arch/$(ARCHDIR)/Makefile +# Build-time information (git hash and build number) $(BUILDINFO_SRC): $(filter-out $(BUILDINFO_OBJ), $(OBJ)) $(MODS) arch/$(ARCHDIR)/link.ld Makefile @echo "#include " > $@ @echo "const char gsGitHash[] = \""`git log -n 1 | head -n 1 | awk '{print $$2}'`"\";" >> $@ @echo "const int giBuildNumber = $(BUILD_NUM);" >> $@ +# Compile rule for buildinfo (needs a special one because it's not a general source file) $(BUILDINFO_OBJ): $(BUILDINFO_SRC) @echo --- CC -o $@ @$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<