More work on neatening code
authorJohn Hodge <[email protected]>
Tue, 7 Feb 2012 09:58:36 +0000 (17:58 +0800)
committerJohn Hodge <[email protected]>
Tue, 7 Feb 2012 09:58:36 +0000 (17:58 +0800)
KernelLand/Kernel/Makefile
KernelLand/Makefile.cfg [new file with mode: 0644]
KernelLand/Modules/Makefile.tpl
Makefile
Usermode/Libraries/ld-acess.so_src/arch/armv7.S.h
Usermode/Libraries/ld-acess.so_src/arch/syscalls.s.h
Usermode/Libraries/ld-acess.so_src/arch/x86_64.asm.h

index d0c8dbf..531ab65 100644 (file)
@@ -92,7 +92,7 @@ install: $(BIN)
 apidoc:
        doxygen Doxyfile.api
 
-$(BIN): $(OBJ) $(MODS) arch/$(ARCHDIR)/link.ld Makefile ../BuildConf/$(ARCH)/Makefile.cfg ../BuildConf/$(ARCH)/$(PLATFORM).mk
+$(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
diff --git a/KernelLand/Makefile.cfg b/KernelLand/Makefile.cfg
new file mode 100644 (file)
index 0000000..ca63095
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# Usermode Makefile.cfg
+#
+
+# Include Root Makefile.cfg
+-include $(dir $(lastword $(MAKEFILE_LIST)))../Makefile.cfg
+
index f1c31a5..0393b61 100644 (file)
@@ -6,10 +6,10 @@ _CPPFLAGS := $(CPPFLAGS)
 
 -include $(dir $(lastword $(MAKEFILE_LIST)))../Makefile.cfg
 
-LIBINCLUDES := $(addprefix -I$(ACESSDIR)/Modules/,$(DEPS))
+LIBINCLUDES := $(addprefix -I$(ACESSDIR)/KernelLand/Modules/,$(DEPS))
 LIBINCLUDES := $(addsuffix /include,$(LIBINCLUDES))
 
-CPPFLAGS := -I$(ACESSDIR)/Kernel/include -I$(ACESSDIR)/Kernel/arch/$(ARCHDIR)/include
+CPPFLAGS := -I$(ACESSDIR)/KernelLand/Kernel/include -I$(ACESSDIR)/KernelLand/Kernel/arch/$(ARCHDIR)/include
 CPPFLAGS += -DARCH=$(ARCH) -DARCH_is_$(ARCH) -DARCHDIR_is_$(ARCHDIR)
 CPPFLAGS += $(_CPPFLAGS)
 CPPFLAGS += $(LIBINCLUDES)
index 4597d87..faa0ab3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -54,16 +54,20 @@ clean:      $(CLEAN_DYNMODS) $(CLEAN_MODULES) clean-Kernel $(CLEAN_USRLIBS) $(CLEAN_U
 install:       install-Filesystem SyscallList $(INSTALL_USRLIBS) $(INSTALL_USRAPPS) $(INSTALL_DYNMODS) $(INSTALL_MODULES) install-Kernel
 
 SyscallList: include/syscalls.h
-include/syscalls.h: Kernel/Makefile Kernel/syscalls.lst
-       @make -C Kernel/ include/syscalls.h
+include/syscalls.h: KernelLand/Kernel/Makefile KernelLand/Kernel/syscalls.lst
+       @make -C KernelLand/Kernel/ include/syscalls.h
+
+_build_dynmod := BUILDTYPE=dynamic $(SUBMAKE) -C KernelLand/Modules/
+_build_stmod  := BUILDTYPE=static $(SUBMAKE) -C KernelLand/Modules/
+_build_kernel := $(SUBMAKE) $1 -C KernelLand/Kernel
 
 # Compile Only
 $(ALL_DYNMODS): all-%:
-       +@echo === Dynamic Module: $* && BUILDTYPE=dynamic $(SUBMAKE) all -C Modules/$*
+       +@echo === Dynamic Module: $* && $(_build_dynmod)$* all
 $(ALL_MODULES): all-%:
-       +@echo === Module: $* && BUILDTYPE=static $(SUBMAKE) all -C Modules/$*
+       +@echo === Module: $* && $(_build_stmod)$* all
 all-Kernel:
-       +@echo === Kernel && $(SUBMAKE) all -C Kernel
+       +@echo === Kernel && $(_build_kernel) all
 $(ALL_USRLIBS): all-%:
        +@echo === User Library: $* && $(SUBMAKE) all -C Usermode/Libraries/$*_src
 $(ALL_USRAPPS): all-%:
@@ -71,11 +75,11 @@ $(ALL_USRAPPS): all-%:
 
 # Compile & Install
 $(AI_DYNMODS): allinstall-%:
-       +@echo === Dynamic Module: $* && BUILDTYPE=dynamic $(SUBMAKE) all install -C Modules/$*
+       +@echo === Dynamic Module: $* && $(_build_dynmod)$* all install
 $(AI_MODULES): allinstall-%:
-       +@echo === Module: $* && BUILDTYPE=static $(SUBMAKE) all install -C Modules/$*
+       +@echo === Module: $* && $(_build_stmod)$* all install
 allinstall-Kernel:
-       +@echo === Kernel && $(SUBMAKE) all install -C Kernel
+       +@echo === Kernel && $(_build_kernel) all install
 $(AI_USRLIBS): allinstall-%:
        +@echo === User Library: $* && $(SUBMAKE) all install -C Usermode/Libraries/$*_src
 $(AI_USRAPPS): allinstall-%:
@@ -83,11 +87,11 @@ $(AI_USRAPPS): allinstall-%:
 
 # Clean up compilation
 $(CLEAN_DYNMODS): clean-%:
-       +@BUILDTYPE=dynamic $(SUBMAKE) clean -C Modules/$*
+       +@$(_build_dynmod)$* clean
 $(CLEAN_MODULES): clean-%:
-       +@BUILDTYPE=static $(SUBMAKE) clean -C Modules/$*
+       +@$(_build_stmod)$* clean
 clean-Kernel:
-       +@$(SUBMAKE) clean -C Kernel
+       +@$(_build_kernel) clean
 $(CLEAN_USRLIBS): clean-%:
        +@$(SUBMAKE) clean -C Usermode/Libraries/$*_src
 $(CLEAN_USRAPPS): clean-%:
@@ -95,13 +99,13 @@ $(CLEAN_USRAPPS): clean-%:
 
 # Install
 $(INSTALL_DYNMODS): install-%:
-       @BUILDTYPE=dynamic $(SUBMAKE) install -C Modules/$*
+       @$(_build_dynmod)$* install
 $(INSTALL_MODULES): install-%:
-       @BUILDTYPE=static $(SUBMAKE) install -C Modules/$*
+       @$(_build_stmod)$* install
 install-Filesystem:
        @$(SUBMAKE) install -C Usermode/Filesystem
 install-Kernel:
-       @$(SUBMAKE) install -C Kernel
+       @$(_build_kernel) install
 $(INSTALL_USRLIBS): install-%:
        @$(SUBMAKE) install -C Usermode/Libraries/$*_src
 $(INSTALL_USRAPPS): install-%:
index 560b809..9132c02 100644 (file)
@@ -2,8 +2,6 @@
 // Acess2 ARMv7 - System Calls
 //
 
-#include "../../../../Kernel/include/syscalls.h"
-
 .globl _start
 .extern SoMain
 _start:
index cd20d80..88cea59 100644 (file)
@@ -1,3 +1,5 @@
+#include "../../../../KernelLand/Kernel/include/syscalls.h"
+
 // --- Process Control ---
 SYSCALL1(_exit, SYS_EXIT)
 
index 9f7be4e..350585a 100644 (file)
@@ -2,8 +2,6 @@
 ; AcssMicro - System Calls
 ; ========================
 
-#include "../../../../Kernel/include/syscalls.h"
-
 [bits 64]
 
 [section .text]

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