Subversion Repositories shark

Rev

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

include $(BASE)/shark.cfg

CPP = gcc
CC  = gcc
AS  = gcc
LD  = ld
AR  = ar

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

INCL   = $(BASE)/include
LIB_PATH    = $(BASE)/lib
OSLIB = $(BASE)/oslib
OSLIB_PATH = $(OSLIB)/lib
LIB_DIR  = $(BASE)/lib

LIBRARYPATHNAME= $(LIB_PATH)/lib$(LIBRARY).a
LIBRARYDIR= $(LIB_PATH)
LIBRARYOBJS= $(LIB_OBJS)

#LIBRARYPATHNAME= $(subst /,\,$(LIB_PATH)/lib$(LIBRARY).a)
#LIBRARYDIR= $(subst /,\,$(LIB_PATH))
#LIBRARYOBJS= $(subst /,\,$(LIB_OBJS))

ifeq ($(findstring NEW,$(TRACER)) , NEW)
CFG_OPT += -D__NEW_TRACER__
endif
ifeq ($(findstring OLD,$(TRACER)) , OLD)
CFG_OPT += -D__OLD_TRACER__
endif
INCL += -I$(BASE)/tracer/include

ifeq ($(findstring VM86,$(BIOS)) , VM86)
CFG_OPT += -DVM86
endif

C_WARN       = -Wimplicit-function-declaration -Wall
C_FLAGS      = -O -fno-builtin -nostdinc
C_INC        = -I$(INCL) $(OTHERINCL) -I$(OSLIB)
C_MAC        = -D__GNU__ $(CFG_OPT)

ASM_WARN     =
ASM_FLAGS    = -x assembler-with-cpp
ASM_INC      = -I$(INCL) -I$(OSLIB)
ASM_MAC      = -D__GNU__ $(CFG_OPT)

LINK_OPT = -Bstatic -Ttext 0x1720000 -b coff-go32 --oformat coff-go32 -s -nostartfiles -nostdlib -L$(LIB_PATH) -L$(OSLIB_PATH)

C_OPT        = $(C_DEF) $(C_WARN) $(C_INC) $(C_MAC) $(C_FLAGS)
C_OUTPUT     = -o $*.o

ASM_OPT      = $(ASM_DEF) $(ASM_WARN) $(ASM_INC) $(ASM_MAC) $(ASM_FLAGS)
ASM_OUTPUT   = -o $*.o


MKDIR   = md
CP      = cp
CAT     = @type
RM      = rm -f
CD      = cd

#REDIR=redir -e $(*F).err
REDIR=

# Common rules
%.o : %.s
        $(REDIR) $(CC) $(ASM_OPT) $(ASM_OUTPUT) -c $<
%.o : %.c
        $(REDIR) $(CC) $(C_OPT) $(C_OUTPUT) -c $<
%.s : %.c
        $(REDIR) $(CC) $(C_OPT) $(C_OUTPUT) -S $<
%.o : %.cpp
        $(REDIR) $(CPP) $(C_OPT) $(C_OUTPUT) -c $<