X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=KernelLand%2FKernel%2FMakefile;h=40fb4a1ca12c6546d9f010a35c50237d8d200da0;hb=93a6bfbef3c85c3449826d1fbdc9aa08faa1dc20;hp=7562079cde0f1374686d0d83f9b5fcb9f0bd93f5;hpb=3d85d14c564e245c00d31b1adf9c4ee7c2d9754a;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/Makefile b/KernelLand/Kernel/Makefile index 7562079c..40fb4a1c 100644 --- a/KernelLand/Kernel/Makefile +++ b/KernelLand/Kernel/Makefile @@ -96,14 +96,12 @@ apidoc: # 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 - @wc -l $(SRCFILES) include/*.h > LineCounts.$(ARCH).txt @echo BUILD_NUM = $$(( $(BUILD_NUM) + 1 )) > Makefile.BuildNum.$(ARCH) $(POSTBUILD) @cp $(BIN) $(BIN)_ @@ -135,14 +133,18 @@ $(OBJDIR)%.o$(OBJSUFFIX): %.c Makefile include/syscalls.h include/syscalls.inc.asm: syscalls.lst Makefile GenSyscalls.pl perl GenSyscalls.pl -# Rules based on the makefile -Makefile: ../../Makefile.cfg arch/$(ARCHDIR)/Makefile +# Differences for the makefile +Makefile: ../../Makefile.cfg ../../BuildConf/$(ARCH)/Makefile.cfg ../../BuildConf/$(ARCH)/$(PLATFORM).mk arch/$(ARCHDIR)/Makefile # Build-time information (git hash and build number) $(BUILDINFO_SRC): $(filter-out $(BUILDINFO_OBJ), $(OBJ)) $(MODS) arch/$(ARCHDIR)/link.ld Makefile + $(eval _GITHASH=$(shell git log -n 1 | head -n 1 | awk '{print $$2}')) + $(eval _GITCHANGED=$(shell git status --porcelain | grep -c '^ M ')) @echo "#include " > $@ - @echo "const char gsGitHash[] = \""`git log -n 1 | head -n 1 | awk '{print $$2}'`"\";" >> $@ + @echo "const char gsGitHash[] = \"$(_GITHASH)\";" >> $@ @echo "const int giBuildNumber = $(BUILD_NUM);" >> $@ + @echo "const char gsBuildInfo[] = \"Acess2 v$(KERNEL_VERSION) $(ARCH)-$(PLATFORM)\\\\r\\\\n\"" >> $@ + @echo " \"Build $(shell hostname --fqdn):$(BUILD_NUM) Git $(_GITHASH) - $(_GITCHANGED) modified\";" >> $@ # Compile rule for buildinfo (needs a special one because it's not a general source file) $(BUILDINFO_OBJ): $(BUILDINFO_SRC) @echo --- CC -o $@ @@ -151,4 +153,3 @@ $(BUILDINFO_OBJ): $(BUILDINFO_SRC) # Dependency Files -include $(DEPFILES) -%.h: