X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2FMakefile;h=da0ecb7222fd6ba3a8210942dfe235e4cf854ee2;hb=babde54b9962aad735a990c648ae3aae0ae928b4;hp=d0c8dbf656a272e86549950038c9b51de0445dda;hpb=48743e39650eb1ef988380e9d95f27fd40d3a9ce;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/Makefile b/KernelLand/Kernel/Makefile index d0c8dbf6..da0ecb72 100644 --- a/KernelLand/Kernel/Makefile +++ b/KernelLand/Kernel/Makefile @@ -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,10 +91,17 @@ install: $(BIN) @$(RM) $(BIN)_ $(xCP) $(GZBIN) $(DISTROOT) +# Compile API documentation apidoc: doxygen Doxyfile.api -$(BIN): $(OBJ) $(MODS) arch/$(ARCHDIR)/link.ld Makefile ../BuildConf/$(ARCH)/Makefile.cfg ../BuildConf/$(ARCH)/$(PLATFORM).mk +# 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 @$(DISASM) -S $(BIN) > $(BIN).dsm @@ -100,6 +109,7 @@ $(BIN): $(OBJ) $(MODS) arch/$(ARCHDIR)/link.ld Makefile ../BuildConf/$(ARCH)/Mak @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 $<