From 542d8ba58741acef4f373b8e4395e03136c5404c Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 5 Oct 2011 12:09:43 +0800 Subject: [PATCH] AcessNative - Fixing build --- AcessNative/acesskernel_src/Makefile | 33 ++++++++++++++++---------- AcessNative/acesskernel_src/keyboard.c | 3 +-- AcessNative/acesskernel_src/syscalls.c | 2 +- AcessNative/acesskernel_src/ui_sdl.c | 2 +- AcessNative/acesskernel_src/video.c | 5 +--- AcessNative/ld-acess_src/Makefile | 21 ++++++++-------- 6 files changed, 36 insertions(+), 30 deletions(-) diff --git a/AcessNative/acesskernel_src/Makefile b/AcessNative/acesskernel_src/Makefile index 74f8920a..91bee8b3 100644 --- a/AcessNative/acesskernel_src/Makefile +++ b/AcessNative/acesskernel_src/Makefile @@ -17,12 +17,12 @@ N_OBJ := main.o OBJ := helpers.o threads.o server.o syscalls.o OBJ += video.o keyboard.o mouse.o nativefs.o vfs_handle.o ui_sdl.o -OBJ += $(addprefix $(KERNEL_SRC),$(KERNEL_OBJ)) +OBJ := $(addprefix obj-$(PLATFORM)/,$(OBJ)) +N_OBJ := $(addprefix obj-$(PLATFORM)/,$(N_OBJ)) +K_OBJ := $(addprefix $(KERNEL_SRC)obj-$(PLATFORM)/,$(KERNEL_OBJ)) -OBJ := $(addsuffix .$(PLATFORM),$(OBJ)) -N_OBJ := $(addsuffix .$(PLATFORM),$(N_OBJ)) -DEPFILES = $(filter %.o.$(PLATFORM),$(OBJ) $(N_OBJ)) -DEPFILES := $(DEPFILES:%.o.$(PLATFORM)=%.d.$(PLATFORM)) +DEPFILES = $(filter %.o,$(OBJ) $(N_OBJ) $(K_OBJ)) +DEPFILES := $(DEPFILES:%=%.dep) CPPFLAGS += -I include/ -I $(KERNEL_SRC)include/ CFLAGS += -Wall -g @@ -41,20 +41,29 @@ endif all: $(BIN) clean: - $(RM) $(BIN) $(OBJ) $(N_OBJ) $(DEPFILES) + $(RM) $(BIN) $(OBJ) $(N_OBJ) $(K_OBJ) $(DEPFILES) -$(BIN): $(OBJ) $(N_OBJ) +$(BIN): $(OBJ) $(N_OBJ) $(K_OBJ) @echo [LINK] -o $@ - @$(CC) $(LDFLAGS) -o $@ $(N_OBJ) $(OBJ) + @$(CC) $(LDFLAGS) -o $@ $(N_OBJ) $(K_OBJ) $(OBJ) -$(OBJ): %.o.$(PLATFORM): %.c +$(OBJ): obj-$(PLATFORM)/%.o: %.c + @mkdir -p $(dir $@) @echo [CC] -o $@ @$(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) - @$(CC) -M $(CPPFLAGS) -MT $@ -o $*.d.$(PLATFORM) $< + @$(CC) -M $(CPPFLAGS) -MT $@ -o $@.dep $< -$(N_OBJ): %.o.$(PLATFORM): %.c +$(K_OBJ): $(KERNEL_SRC)obj-$(PLATFORM)/%.o: $(KERNEL_SRC)%.c + @mkdir -p $(dir $@) + @echo [CC] -o $@ + @$(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) + @$(CC) -M $(CPPFLAGS) -MT $@ -o $@.dep $< + + +$(N_OBJ): obj-$(PLATFORM)/%.o: %.c + @mkdir -p $(dir $@) @echo [CC] -o $@ @$(CC) -c $< -o $@ $(CFLAGS) - @$(CC) -M -MT $@ -o $*.d.$(PLATFORM) $< + @$(CC) -M -MT $@ -o $@.dep $< -include $(DEPFILES) diff --git a/AcessNative/acesskernel_src/keyboard.c b/AcessNative/acesskernel_src/keyboard.c index 86f37874..329e003d 100644 --- a/AcessNative/acesskernel_src/keyboard.c +++ b/AcessNative/acesskernel_src/keyboard.c @@ -6,8 +6,7 @@ #include #include #include -#include -#include +#include #include "ui.h" // === PROTOTYPES === diff --git a/AcessNative/acesskernel_src/syscalls.c b/AcessNative/acesskernel_src/syscalls.c index b41e3544..70e09f19 100644 --- a/AcessNative/acesskernel_src/syscalls.c +++ b/AcessNative/acesskernel_src/syscalls.c @@ -117,7 +117,7 @@ SYSCALL5(Syscall_select, "idddd", int, fd_set *, fd_set *, fd_set *, time_t *, return VFS_Select(a0, a1, a2, a3, a4, 0); ); SYSCALL3(Syscall_OpenChild, "isi", int, const char *, int, - return VFS_OpenChild(NULL, a0, a1, a2|VFS_OPENFLAG_USER); + return VFS_OpenChild(a0, a1, a2|VFS_OPENFLAG_USER); ); SYSCALL2(Syscall_GetACL, "id", int, void *, if(Sizes[1] < sizeof(tVFS_ACL)) diff --git a/AcessNative/acesskernel_src/ui_sdl.c b/AcessNative/acesskernel_src/ui_sdl.c index 2e56a647..11033d98 100644 --- a/AcessNative/acesskernel_src/ui_sdl.c +++ b/AcessNative/acesskernel_src/ui_sdl.c @@ -7,7 +7,7 @@ #define const #include "ui.h" #undef const -#include +#include // === IMPORTS === extern void AcessNative_Exit(void); diff --git a/AcessNative/acesskernel_src/video.c b/AcessNative/acesskernel_src/video.c index 2c38533d..304a9cf4 100644 --- a/AcessNative/acesskernel_src/video.c +++ b/AcessNative/acesskernel_src/video.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "ui.h" // === PROTOTYPES === @@ -294,9 +294,6 @@ int Video_IOCtl(tVFS_Node *Node, int ID, void *Data) //Log_Debug("VESA", "Cursor position (%i,%i) Timer %i", giVesaCursorX, giVesaCursorY, giVesaCursorTimer); return 0; #endif - - case VIDEO_IOCTL_REQLFB: // Request Linear Framebuffer - return 0; } return 0; } diff --git a/AcessNative/ld-acess_src/Makefile b/AcessNative/ld-acess_src/Makefile index eb84ad89..5a604a3c 100644 --- a/AcessNative/ld-acess_src/Makefile +++ b/AcessNative/ld-acess_src/Makefile @@ -7,7 +7,7 @@ endif OBJ := main.o syscalls.o request.o binary.o memory.o OBJ += elf.o -OBJ := $(addsuffix .$(PLATFORM),$(OBJ)) +OBJ := $(addprefix obj-$(PLATFORM)/,$(OBJ)) ifeq ($(PLATFORM),win) BIN := ../ld-acess.exe @@ -19,8 +19,8 @@ endif CFLAGS += -Wall -Werror -g -m32 -DEPFILES = $(filter %.o.$(PLATFORM),$(OBJ)) -DEPFILES := $(DEPFILES:%.o.$(PLATFORM)=%.d.$(PLATFORM)) +DEPFILES = $(filter %.o,$(OBJ)) +DEPFILES := $(DEPFILES:%=%.dep) .PHONY: all clean @@ -29,18 +29,19 @@ all: $(BIN) clean: $(RM) $(BIN) $(OBJ) $(DEPFILES) -$(BIN): link.ld.$(PLATFORM) $(OBJ) -# $(LD) -g -o $@ $(OBJ) -T link.ld.$(PLATFORM) - $(CC) -g -o $@ $(OBJ) -m32 -Wl,-T,link.ld.$(PLATFORM) +$(BIN): obj-$(PLATFORM)/link.ld $(OBJ) + $(CC) -g -o $@ $(OBJ) -m32 -Wl,-T,obj-$(PLATFORM)/link.ld -%.o.$(PLATFORM): %.c +obj-$(PLATFORM)/%.o: %.c + @mkdir -p $(dir $@) @echo [CC] -o $@ @$(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) - @$(CC) -M $(CPPFLAGS) -MT $@ -o $*.d.$(PLATFORM) $< + @$(CC) -M $(CPPFLAGS) -MT $@ -o $@.dep $< # Modify the default makefile to put the executable at 1MB instead -link.ld.lin: - @echo Making Linker Script ($@) +obj-lin/link.ld: + @mkdir -p $(dir $@) + @echo "Making Linker Script ($@)" @$(LD) --verbose | awk '{ if( substr($$0,0,5) == "====="){ bPrint = !bPrint; } else { if(bPrint){ print $$0;} } }' | sed 's/\b0x0[08][0-9]*\b/0x00100000/g' > $@ -include $(DEPFILES) -- 2.20.1