Merge branch 'master' of github.com:thepowersgang/acess2
authorJohn Hodge <[email protected]>
Tue, 24 Jul 2012 11:30:31 +0000 (19:30 +0800)
committerJohn Hodge <[email protected]>
Tue, 24 Jul 2012 11:30:31 +0000 (19:30 +0800)
1  2 
KernelLand/Kernel/Makefile

@@@ -25,7 -25,7 +25,7 @@@ ASFLAGS         += -D ARCHDIR_IS_$(ARCH
  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) -ffreestanding
- CFLAGS        += -Wall -fno-stack-protector -Wstrict-prototypes -g
+ CFLAGS        += -Wall -fno-stack-protector -Wstrict-prototypes -std=gnu99 -g
  CFLAGS        += -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wuninitialized
  CFLAGS          += -O3
  LDFLAGS               += -T arch/$(ARCHDIR)/link.ld -g
@@@ -51,6 -51,7 +51,7 @@@ BUILDINFO_OBJ := $(OBJDIR)buildinfo.o$(
  BUILDINFO_SRC := $(OBJDIR)buildinfo.c$(OBJSUFFIX)
  
  OBJ := $(addprefix arch/$(ARCHDIR)/,$(A_OBJ))
+ OBJ += pmemmap.o
  OBJ += heap.o logging.o debug.o lib.o libc.o adt.o time.o
  OBJ += drvutil_video.o drvutil_disk.o
  OBJ += messages.o modules.o syscalls.o system.o
@@@ -95,18 -96,16 +96,16 @@@ 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)_
 -      @$(STRIP) $(BIN)_
 +      @-$(STRIP) $(BIN)_
        @gzip -c $(BIN)_ > $(GZBIN)
        @$(RM) $(BIN)_
  
@@@ -116,7 -115,7 +115,7 @@@ $(OBJDIR)%.ao$(OBJSUFFIX): %.$(AS_SUFFI
        @mkdir -p $(dir $@)
        @$(AS) $(ASFLAGS) $< -o $@
  ifeq ($(AS_SUFFIX),S)
-       @$(MAKEDEP) $(CPPFLAGS) -MT $@ -o $(OBJDIR)$*.ao.dep$(OBJSUFFIX) $<
+       @$(MAKEDEP) $(CPPFLAGS) -MT $@ -MP -o $(OBJDIR)$*.ao.dep$(OBJSUFFIX) $<
  endif
  
  # C Sources
@@@ -124,7 -123,7 +123,7 @@@ $(OBJDIR)%.o$(OBJSUFFIX): %.c Makefil
        @echo --- CC -o $@
        @mkdir -p $(dir $@)
        @$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
-       @$(MAKEDEP) $(CPPFLAGS) -MT $@ -o $(OBJDIR)$*.o.dep$(OBJSUFFIX) $<
+       @$(MAKEDEP) $(CPPFLAGS) -MT $@ -MP -o $(OBJDIR)$*.o.dep$(OBJSUFFIX) $<
  
  # Build-time linked modules
  %.xo.$(ARCH):
  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 <acess.h>" > $@
-       @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 $@
  
  # Dependency Files
  -include $(DEPFILES)

UCC git Repository :: git.ucc.asn.au