# Acess2 Build Configuration
#
-CC = gcc
-LD = ld
-AS = nasm
-OBJDUMP = objdump
-RM = @rm -f
-STRIP = strip
-MKDIR = mkdir
-RMDIR = rm -rf
-lCP = cp
-xCP = mcopy -D o
-xMKDIR = mmd
-xRMDIR = mdeltree
-xRM = mdel
+# Source and destination configuration
+DISTROOT := a:/Acess2
+ACESSDIR := $(dir $(lastword $(MAKEFILE_LIST)))
+ACESSDIR := $(shell cd $(ACESSDIR) && pwd)
+
+# Default build programs
+CC := gcc
+LD := ld
+AS := nasm
+DISASM := objdump -d -S
+RM := @rm -f
+STRIP := strip
+MKDIR := mkdir -p
+RMDIR := rm -rf
+lCP := cp
+xCP := mcopy -D o
+xMKDIR := mmd
+
+# Load Architecture settings
ifeq ($(ARCH),)
- ARCH = i386
+ ARCH := i386
endif
+-include $(ACESSDIR)/Makefile.$(ARCH).cfg
ifeq ($(ARCHDIR),)
- ARCHDIR = x86
+ ARCHDIR := x86
endif
+-include $(ACESSDIR)/Makefile.$(ARCHDIR).cfg
-FILESYSTEMS = fat
-DRIVERS = ata_x86
-MODULES = FS_Ext2 FDD NE2000 BochsGA IPStack
-DYNMODS = USB UDI
-
-#DISTROOT = /mnt/AcessHDD/Acess2
-#DISTROOT = ~/Projects/Acess2/Filesystem
-DISTROOT = a:/Acess2
-ACESSDIR = /home/tpg/Projects/Acess2
+FILESYSTEMS :=
+DRIVERS :=
+MODULES := Storage/ATA Storage/FDD
+MODULES += Network/NE2000
+MODULES += Display/VESA
+#MODULES += Display/BochsGA
+MODULES += Filesystems/Ext2
+MODULES += Filesystems/FAT
+MODULES += Filesystems/NTFS
+MODULES += IPStack
+DYNMODS := USB/Core
+MODULES += Interfaces/UDI