\r
OBJ := helpers.o threads.o server.o syscalls.o\r
OBJ += video.o keyboard.o mouse.o nativefs.o vfs_handle.o ui_sdl.o\r
-OBJ += $(addprefix $(KERNEL_SRC),$(KERNEL_OBJ))\r
+OBJ := $(addprefix obj-$(PLATFORM)/,$(OBJ))\r
+N_OBJ := $(addprefix obj-$(PLATFORM)/,$(N_OBJ))\r
+K_OBJ := $(addprefix $(KERNEL_SRC)obj-$(PLATFORM)/,$(KERNEL_OBJ))\r
\r
-OBJ := $(addsuffix .$(PLATFORM),$(OBJ))\r
-N_OBJ := $(addsuffix .$(PLATFORM),$(N_OBJ))\r
-DEPFILES = $(filter %.o.$(PLATFORM),$(OBJ) $(N_OBJ))\r
-DEPFILES := $(DEPFILES:%.o.$(PLATFORM)=%.d.$(PLATFORM))\r
+DEPFILES = $(filter %.o,$(OBJ) $(N_OBJ) $(K_OBJ))\r
+DEPFILES := $(DEPFILES:%=%.dep)\r
\r
CPPFLAGS += -I include/ -I $(KERNEL_SRC)include/\r
CFLAGS += -Wall -g\r
all: $(BIN)\r
\r
clean:\r
- $(RM) $(BIN) $(OBJ) $(N_OBJ) $(DEPFILES)\r
+ $(RM) $(BIN) $(OBJ) $(N_OBJ) $(K_OBJ) $(DEPFILES)\r
\r
-$(BIN): $(OBJ) $(N_OBJ)\r
+$(BIN): $(OBJ) $(N_OBJ) $(K_OBJ)\r
@echo [LINK] -o $@\r
- @$(CC) $(LDFLAGS) -o $@ $(N_OBJ) $(OBJ)\r
+ @$(CC) $(LDFLAGS) -o $@ $(N_OBJ) $(K_OBJ) $(OBJ)\r
\r
-$(OBJ): %.o.$(PLATFORM): %.c\r
+$(OBJ): obj-$(PLATFORM)/%.o: %.c\r
+ @mkdir -p $(dir $@)\r
@echo [CC] -o $@\r
@$(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)\r
- @$(CC) -M $(CPPFLAGS) -MT $@ -o $*.d.$(PLATFORM) $<\r
+ @$(CC) -M $(CPPFLAGS) -MT $@ -o $@.dep $<\r
\r
-$(N_OBJ): %.o.$(PLATFORM): %.c\r
+$(K_OBJ): $(KERNEL_SRC)obj-$(PLATFORM)/%.o: $(KERNEL_SRC)%.c\r
+ @mkdir -p $(dir $@)\r
+ @echo [CC] -o $@\r
+ @$(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)\r
+\r
+\r
+$(N_OBJ): obj-$(PLATFORM)/%.o: %.c\r
+ @mkdir -p $(dir $@)\r
@echo [CC] -o $@\r
@$(CC) -c $< -o $@ $(CFLAGS)\r
- @$(CC) -M -MT $@ -o $*.d.$(PLATFORM) $<\r
+ @$(CC) -M -MT $@ -o $@.dep $<\r
\r
-include $(DEPFILES)\r
#include <acess.h>
#include <modules.h>
#include <fs_devfs.h>
-#include <tpl_drv_common.h>
-#include <tpl_drv_keyboard.h>
+#include <api_drv_keyboard.h>
#include "ui.h"
// === PROTOTYPES ===
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))
#define const
#include "ui.h"
#undef const
-#include <tpl_drv_keyboard.h>
+#include <api_drv_keyboard.h>
// === IMPORTS ===
extern void AcessNative_Exit(void);
#include <vfs.h>
#include <fs_devfs.h>
#include <modules.h>
-#include <tpl_drv_video.h>
+#include <api_drv_video.h>
#include "ui.h"
// === PROTOTYPES ===
//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;
}
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
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
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)