You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.1 KiB
Makefile

# Configuration for the Cisco 3620/3640 Routers
16 years ago
TARGET=c3600
MACHCODE=0x1e
TEXTADDR=0x80008000
LOADADDR=0x80028000
16 years ago
ifndef CROSS_COMPILE
CROSS_COMPILE=mips-elf-
endif
CFLAGS=-DDEBUG -mno-abicalls
LDFLAGS=-Ttext ${TEXTADDR}
16 years ago
# Configuration for the Cisco 3660 Routers
# TARGET=c3600
# MACHCODE=0x34
# TEXTADDR=0x80008000
# LOADADDR=0x80028000
16 years ago
# ifndef CROSS_COMPILE
# CROSS_COMPILE=mips-elf-
# endif
# CFLAGS=-DDEBUG -mno-abicalls
# LDFLAGS=-Ttext ${TEXTADDR}
16 years ago
# Configuration for the Cisco 1700 Series Routers
# TARGET=c1700
# MACHCODE=0x33
# TEXTADDR=0x80008000
# LOADADDR=0x80028000
# ifndef CROSS_COMPILE
# CROSS_COMPILE=powerpc-elf-
# endif
# LDFLAGS=-Ttext=${TEXTADDR}
16 years ago
# additional CFLAGS
CFLAGS+=
16 years ago
# don't modify anything below here
# ===================================================================
PROG=ciscoload
CC=$(CROSS_COMPILE)gcc
AR=$(CROSS_COMPILE)ar
LD=$(CROSS_COMPILE)ld
OBJCOPY=$(CROSS_COMPILE)objcopy
MACHDIR=mach/$(TARGET)
16 years ago
# command to prepare a binary
RAW=${OBJCOPY} --strip-unneeded --alt-machine-code ${MACHCODE}
INCLUDE=-Iinclude/ -Imach/${TARGET} -Iinclude/mach/${TARGET}
16 years ago
CFLAGS+=-fno-builtin -fomit-frame-pointer -fno-pic \
-Wall -DLOADADDR=${LOADADDR}
16 years ago
ASFLAGS=-D__ASSEMBLY__-xassembler-with-cpp -traditional-cpp
16 years ago
LDFLAGS+=--omagic -nostartfiles -nostdlib --discard-all --strip-all \
--entry _start
16 years ago
OBJECTS=string.o main.o ciloio.o printf.o elf_loader.o lzma_loader.o \
LzmaDecode.o
LINKOBJ=${OBJECTS} $(MACHDIR)/promlib.o $(MACHDIR)/start.o $(MACHDIR)/platio.o\
$(MACHDIR)/platform.o
THISFLAGS='LDFLAGS=$(LDFLAGS)' 'ASFLAGS=$(ASFLAGS)' \
'CROSS_COMPILE=$(CROSS_COMPILE)' 'CFLAGS=$(CFLAGS)' 'CC=$(CC)'
16 years ago
all: ${OBJECTS} ${PROG}
${PROG}: sub ${OBJECTS}
${CC} ${LDFLAGS} ${LINKOBJ} -o ${PROG}.elf
16 years ago
${RAW} ${PROG}.elf ${PROG}.bin
.c.o:
${CC} ${CFLAGS} $(INCLUDE) -c $<
16 years ago
.S.o:
${CC} ${CFLAGS} $(INCLUDE) ${ASFLAGS} -c $<
sub:
@for i in $(MACHDIR); do \
echo "Making all in $$i..."; \
(cd $$i; $(MAKE) $(MFLAGS) $(THISFLAGS) all); done
subclean:
@for i in $(MACHDIR); do \
echo "Cleaning all in $$i..."; \
(cd $$i; $(MAKE) $(MFLAGS) clean); done
clean: subclean
-rm -f *.o
-rm -f ${PROG}.elf
-rm -f ${PROG}.bin