Subversion Repositories shark

Rev

Rev 558 | Rev 598 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

include $(BASE)/../shark.cfg

CC  = gcc
AS  = gcc
LD  = ld
AR  = ar
INCL   = $(BASE)
LIB_PATH    = $(BASE)/lib/
LIB_DIR  = $(BASE)/lib

ifeq ($(findstring LINUX,$(ENV)) , LINUX)
CFG_OPT += -D__LINUX__
endif
ifeq ($(findstring DJGPP,$(ENV)) , DJGPP)
CFG_OPT += -D__GNU__
endif

ifeq ($(TSC),TRUE)
CFG_OPT += -D__TSC__
ifeq ($(APIC),TRUE)
CFG_OPT += -D__APIC__
endif
endif

ifeq ($(findstring 1000,$(TIMER_OPT)) , 1000)
CFG_OPT += -D__O1000__
else
ifeq ($(findstring 2000,$(TIMER_OPT)) , 2000)
CFG_OPT += -D__O2000__
else
ifeq ($(findstring 4000,$(TIMER_OPT)) , 4000)
CFG_OPT += -D__O4000__
else
CFG_OPT += -D__O8000__
endif
endif
endif

ifeq ($(findstring NEW,$(TRACER)) , NEW)
CFG_OPT += -D__NEW_TRACER__
endif
ifeq ($(findstring OLD,$(TRACER)) , OLD)
CFG_OPT += -D__OLD_TRACER__
endif

C_OPT =  -Wall -O -fno-builtin -nostdinc $(CFG_OPT) -DMAIN=__kernel_init__ -I$(INCL)
ASM_OPT =  -x assembler-with-cpp $(CFG_OPT) -I$(INCL)
LINK_OPT = -Bstatic -Ttext $(MEM_START) -s -nostartfiles -nostdlib -L$(LIB_PATH)

MKDIR   = mkdir
CP      = cp
CAT     = cat
RM      = rm -f
RMDIR   = rm -rf

# Common rules

%.o : %.s
        $(REDIR) $(CC) $(ASM_OPT) -c $<
%.o : %.c
        $(REDIR) $(CC) $(C_OPT) -c $<
%.s : %.c
        $(REDIR) $(CC) $(C_OPT) -S $<