#
# Acess2 Build Configuration
#

ACESSDIR := $(dir $(lastword $(MAKEFILE_LIST)))
ACESSDIR := $(shell cd $(ACESSDIR) && pwd)

# Install destination configuration
DISTROOT := -i $(ACESSDIR)/Acess2.img ::/Acess2
NCC := $(CC)
xCP := mcopy -D o
xMKDIR := mmd -D s

-include $(ACESSDIR)/Makefile.Version.cfg

# 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
ASSUFFIX = asm


# Load Architecture settings
ifeq ($(ARCH),)
	ARCH := x86
endif
include $(ACESSDIR)/BuildConf/$(ARCH)/Makefile.cfg
ifeq ($(ARCHDIR),)
	ARCHDIR := x86
endif

ifneq ($(ARCH),host)
 ifneq ($(ARCHDIR),$(ARCH))
  include $(ACESSDIR)/BuildConf/$(ARCHDIR)/Makefile.cfg
 endif
endif

ifeq ($(PLATFORM),)
	PLATFORM := default
endif

# Makefile.user.cfg is not part of the Acess git repo,
# It is for overriding the options in this file
-include $(ACESSDIR)/Makefile.user.cfg

DRIVERS := 
MODULES :=

MODULES += Filesystems/RAMDisk
MODULES += Filesystems/Ext2
MODULES += Filesystems/FAT
MODULES += Filesystems/NTFS
MODULES += Storage/LVM

include $(ACESSDIR)/BuildConf/$(ARCH)/$(PLATFORM).mk

MODULES += Input/Keyboard Input/Mouse
MODULES += IPStack	# So the other modules are loaded before it
#DYNMODS := USB/Core
#DYNMODS += Filesystems/InitRD

# BUILD_DIST=y - Install to ./Dist
ifneq ($(BUILD_DIST),)
	DISTROOT := $(ACESSDIR)/Dist
	xCP := cp
	xMKDIR := mkdir -p
endif
