head	1.1;
access;
symbols
	arelease:1.1.1.1
	avendor:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2006.01.25.16.59.58;	author igorloi;	state Exp;
branches
	1.1.1.1;
next	;
commitid	327a43d7ae2b4567;

1.1.1.1
date	2006.01.31.10.55.14;	author igorloi;	state Exp;
branches;
next	;
commitid	492e43df419b4567;


desc
@@


1.1
log
@*** empty log message ***
@
text
@# **********************************************
# Programs to build
# **********************************************

PROGS = My_Program

# **********************************************
# Endianness EB | EL
# **********************************************

#ENDIAN  = EB
ENDIAN  = EL

# **********************************************
# Bootstrap object file
# **********************************************

BOOTSTRAP = crt0.o

# **********************************************
# Compiler toolchain
# **********************************************

ifeq ($(ENDIAN),EL)
CC        = mipsel-linux-gcc
LD        = mipsel-linux-ld
OBJCOPY   = mipsel-linux-objcopy
OBJDUMP   = mipsel-linux-objdump
endif

ifeq ($(ENDIAN),EB)
CC        = mips-linux-gcc
LD        = mips-linux-ld
OBJCOPY   = mips-linux-objcopy
OBJDUMP   = mips-linux-objdump
endif

# **********************************************
# Compiler and linker options
# **********************************************

W_OPTS    = -Wimplicit -Wformat -Wall -Wstrict-prototypes
W_OPTS_A  = -Wformat -Wall -Wstrict-prototypes


CC_OPTS   = -Wa,-32 -mips1 -mno-abicalls -fno-pic -G 0 -pipe \
	    -D$(ENDIAN) -fno-strict-aliasing -c -nostdinc

CC_OPTS_A = -Wa,-32 -mips1 -mno-abicalls -fno-pic -G 0 -pipe \
	    -D$(ENDIAN) -fno-strict-aliasing -c -nostdinc


LD_SCRIPT = link.xn
LD_OPTS   = -G 0 -static -T $(LD_SCRIPT)

ifeq ($(ENDIAN),EB)
LD_FORMAT = elf32-tradbigmips
endif

ifeq ($(ENDIAN),EL)
LD_FORMAT = elf32-tradlittlemips
endif


# **********************************************
# Rules
# **********************************************

%.o : %.c
	$(CC) $(W_OPTS) $(CC_OPTS) -o $@@ $<

%.o : %.S
	$(CC) $(W_OPTS_A) $(CC_OPTS_A) -o $@@ $<

%.o : %.s
	$(CC) $(W_OPTS_A) $(CC_OPTS_A) -o $@@ $<

all: $(PROGS)

	
My_Program : $(BOOTSTRAP) My_Program.o
	$(LD) $(LD_OPTS) -o $@@ $?
	$(OBJCOPY) -O binary $@@ $@@.bin

clean :
	rm -f $(PROGS) *.bin *.o
	rm -f *~

@


1.1.1.1
log
@no message
@
text
@@

