summaryrefslogtreecommitdiffstats
path: root/libgloss/m68k/Makefile.in
diff options
context:
space:
mode:
Diffstat (limited to 'libgloss/m68k/Makefile.in')
-rw-r--r--libgloss/m68k/Makefile.in201
1 files changed, 123 insertions, 78 deletions
diff --git a/libgloss/m68k/Makefile.in b/libgloss/m68k/Makefile.in
index ad3f69fdf..c22ef364d 100644
--- a/libgloss/m68k/Makefile.in
+++ b/libgloss/m68k/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (c) 1995, 1996, 2001 Cygnus Support
+# Copyright (c) 1995, 1996, 2001 Cygnus Support -*- mode:makefile -*-
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided
@@ -66,9 +66,8 @@ OBJS = close.o fstat.o getpid.o isatty.o kill.o \
lseek.o open.o print.o putnum.o read.o sbrk.o stat.o \
unlink.o write.o
-CFLAGS = -g
-# ARFLAGS = rv
-
+# What targets to build for. This is a list of {m68k,cf}
+DO = @DO@
# Here is all of the simulator stuff
SIM_SCRIPTS = sim.ld
@@ -118,46 +117,72 @@ IDPGDB_BSP= libidpgdb.a
IDPGDB_OBJS= leds.o idp-inbyte.o idp-gdb-outbyte.o mc68ec.o
#
-# here's all the BDM semihosting stuff
+# here's all the ColdFire boards
#
-BDM_CRT0= bdm-crt0.o
-BDM_BSP= libbdm.a
-BDM_OBJS= bdm-crt1.o bdm-semihost.o $(BDM_SYSOBJS) \
- $(patsubst %,bdm-%.o,${BDM_ISRS})
-BDM_OTHER_OBJS= getpid.o kill.o sbrk.o
-BDM_SYSOBJS= bdm-close.o bdm-exit.o bdm-fstat.o bdm-gdb.o \
- bdm-gettimeofday.o bdm-isatty.o bdm-lseek.o \
- bdm-open.o bdm-read.o bdm-rename.o \
- bdm-stat.o bdm-system.o bdm-time.o bdm-unlink.o bdm-write.o
-BDM_ISRS= other_interrupt reset access_error address_error \
+CF_CRT0S= cf-hosted-crt0.o cf-unhosted-crt0.o
+CF_BSP= libcf.a
+CF_OBJS= cf-isv.o cf-crt1.o cf-hosted.o getpid.o kill.o cf-sbrk.o \
+ cf-exit.o $(patsubst %,cf-%.o,${CF_ISRS})
+CF_ISRS= other_interrupt reset access_error address_error \
illegal_instruction divide_by_zero privilege_violation \
trace unimplemented_line_a_opcode unimplemented_line_f_opcode \
non_pc_breakpoint_debug_interrupt pc_breakpoint_debug_interrupt \
- format_error spurious_interrupt trap0 trap1 trap2 trap3 trap4 \
- trap5 trap6 trap7 trap8 trap9 trap10 trap11 trap12 trap13 trap14 \
- trap15 fp_branch_unordered fp_inexact_result fp_divide_by_zero \
- fp_underflow fp_operand_error fp_overflow fp_input_not_a_number \
- fp_input_denormalized_number unsupported_instruction
-
-CF_BOARDS := m5208evb m5213evb m52235evb m5235evb m5272c3 m5282evb \
- m5329evb m5485evb
+ format_error spurious_interrupt fp_branch_unordered \
+ fp_inexact_result fp_divide_by_zero fp_underflow fp_operand_error \
+ fp_overflow fp_input_not_a_number fp_input_denormalized_number \
+ unsupported_instruction \
+ $(addprefix trap,0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
+
+# RAM ROM
+m5208evb := 1024M 16M 0M 2M
+m5213evb := 512M 32K 0M 256K
+m52235evb := 512M 32K 0M 256K
+m5235evb := 0M 16M 0xFFE00000 2M
+m5273c3 := 0M 4M 0xFFE00000 2M
+m5275evb := 0M 16M 0xFFE00000 2M
+m5282evb := 0M 16M 0xFFE00000 2M
+m5329evb := 1024M 32M 0M 2M
+m5485evb := 0M 64M 1024M 16M
+
+CF_BOARDS := m5208evb m5213evb m52235evb m5235evb m5272c3 m5275evb \
+ m5282evb m5329evb m5485evb
CF_RAM_SCRIPTS := $(patsubst %,%-ram.ld,$(CF_BOARDS))
CF_ROM_SCRIPTS := $(patsubst %,%-rom.ld,$(CF_BOARDS))
-CF_SCRIPTS= $(CF_RAM_SCRIPTS) $(CF_ROM_SCRIPTS)
+CF_HOSTED_SCRIPTS := $(patsubst %.ld,%-hosted.ld,$(CF_RAM_SCRIPTS) $(CF_ROM_SCRIPTS))
+CF_SCRIPTS = $(CF_RAM_SCRIPTS) $(CF_ROM_SCRIPTS) $(CF_HOSTED_SCRIPTS)
+CF_SOURCES = cf-isv.S cf-crt0.S cf-crt1.c asm.h
-# Host specific makefile fragment comes in here.
-@host_makefile_frag@
+#
+# here's all the unhosted stuff
+#
+UNHOSTED_BSP= libunhosted.a
+UNHOSTED_OBJS= unhosted-close.o unhosted-fstat.o \
+ unhosted-gettimeofday.o unhosted-isatty.o unhosted-lseek.o \
+ unhosted-open.o unhosted-read.o unhosted-rename.o \
+ unhosted-stat.o unhosted-system.o unhosted-time.o \
+ unhosted-unlink.o unhosted-write.o
#
-# build a test program for each target board. Just trying to get
-# it to link is a good test, so we ignore all the errors for now.
+# here's all the hosted stuff
#
-all: ${SIM_CRT0} ${SIM_BSP} ${CRT0} ${BCC_BSP} ${IDP_BSP} ${IDPGDB_BSP} \
- ${MVME135_BSP} ${MVME162_BSP} ${BDM_CRT0} ${BDM_BSP} ${CF_SCRIPTS}
+HOSTED_BSP= libhosted.a
+HOSTED_OBJS= hosted-gdb.o hosted-exit.o $(patsubst un%,%,$(UNHOSTED_OBJS))
+
+# Host specific makefile fragment comes in here.
+@host_makefile_frag@
+
+all :: $(DO:%=all_%)
#
# here's where we build the board support packages for each target
#
+
+.PHONY: all_m68k
+all_m68k :: ${SIM_CRT0} ${SIM_BSP} ${CRT0} ${BCC_BSP} ${IDP_BSP} \
+ ${IDPGDB_BSP} ${MVME135_BSP} ${MVME162_BSP}
+.PHONY: all_cf
+all_cf :: ${CF_CRT0S} ${CF_BSP} ${CF_SCRIPTS} ${HOSTED_BSP} ${UNHOSTED_BSP}
+
${SIM_BSP}: ${SIM_OBJS}
${AR} ${ARFLAGS} $@ ${SIM_OBJS}
${RANLIB} $@
@@ -174,10 +199,6 @@ ${IDPGDB_BSP}: $(OBJS) ${IDPGDB_OBJS}
${AR} ${ARFLAGS} $@ $(OBJS) ${IDPGDB_OBJS}
${RANLIB} $@
-${BDM_BSP}: $(BDM_OTHER_OBJS) ${BDM_OBJS}
- ${AR} ${ARFLAGS} $@ $(BDM_OTHER_OBJS) ${BDM_OBJS}
- ${RANLIB} $@
-
${MVME135_BSP}: $(OBJS) ${MVME135_OBJS}
${AR} ${ARFLAGS} $@ $(OBJS) ${MVME135_OBJS}
${RANLIB} $@
@@ -186,52 +207,59 @@ ${MVME162_BSP}: $(OBJS) ${MVME162_OBJS}
${AR} ${ARFLAGS} $@ $(OBJS) ${MVME162_OBJS}
${RANLIB} $@
-$(BDM_SYSOBJS): %.o: %.c bdm-semihost.h bdm-gdb.h
- $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $< -o $@
-bdm-crt0.o : bdm-crt0.S
- $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $< -o $@
-bdm-crt1.o : bdm-crt1.c
- $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $< -o $@
-#We need to omit the frame pointer to ensure there is no prologue.
-bdm-semihost.o : bdm-semihost.c
- $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $< -o $@ -fomit-frame-pointer
-
-# We need to keep the frame pointer to make sure there's some
-# prologue. Otherwise we get confused with the semihosting reoutine.
-$(patsubst %,bdm-%.o,${BDM_ISRS}) : bdm-isrs.c
- $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $< -o $@ \
- -DL_$(patsubst bdm-%.o,%,$@) -fno-omit-frame-pointer
-
-# RAM ROM
-m5208evb := 1024M 16M 0M 2M
-m5213evb := 512M 32K 0M 256K
-m52235evb := 512M 32K 0M 256K
-m5235evb := 0M 16M 0xFFE00000 2M
-m5273c3 := 0M 4M 0xFFE00000 2M
-m5282evb := 0M 16M 0xFFE00000 2M
-m5329evb := 1024M 32M 0M 2M
-m5485evb := 0M 64M 1024M 16M
-
-%-ram.ld : cf.sc Makefile
- RAM=$(word 1,$($*)) RAM_SIZE=$(word 2,$($*)) ${SHELL} $< >$@
-%-rom.ld : cf.sc Makefile
- RAM=$(word 1,$($*)) RAM_SIZE=$(word 2,$($*)) \
- ROM=$(word 3,$($*)) ROM_SIZE=$(word 4,$($*)) ${SHELL} $< >$@
+# build hosted library
+$(HOSTED_OBJS): hosted%.o: io%.c io.h
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) -DHOSTED=1 $(INCLUDES) -c $< -o $@
+$(HOSTED_BSP): $(HOSTED_OBJS)
+ ${AR} ${ARFLAGS} $@ $^
+ ${RANLIB} $@
+cf-hosted-crt0.o: cf-crt0.S
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) -DHOSTED=1 $(INCLUDES) -c $< -o $@
+
+# build unhosted library
+$(UNHOSTED_OBJS): unhosted%.o: io%.c io.h
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) -DHOSTED=0 $(INCLUDES) -c $< -o $@
+$(UNHOSTED_BSP): $(UNHOSTED_OBJS)
+ ${AR} ${ARFLAGS} $@ $^
+ ${RANLIB} $@
+cf-unhosted-crt0.o: cf-crt0.S
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) -DHOSTED=0 $(INCLUDES) -c $< -o $@
+
+# build coldfire library
+$(patsubst %,cf-%.o,${CF_ISRS}) : cf-isrs.c
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -c $< -o $@ \
+ -DL_$(patsubst cf-%.o,%,$@)
+$(CF_BSP): $(CF_OBJS)
+ ${AR} ${ARFLAGS} $@ $^
+ ${RANLIB} $@
+
+m%-ram.ld : cf.sc Makefile
+ IO=unhosted RAM=$(word 1,$(m$*)) RAM_SIZE=$(word 2,$(m$*)) \
+ ${SHELL} $< >$@
+m%-rom.ld : cf.sc Makefile
+ IO=unhosted RAM=$(word 1,$(m$*)) RAM_SIZE=$(word 2,$(m$*)) \
+ ROM=$(word 3,$(m$*)) ROM_SIZE=$(word 4,$(m$*)) ${SHELL} $< >$@
+m%-ram-hosted.ld : cf.sc Makefile
+ IO=hosted RAM=$(word 1,$(m$*)) RAM_SIZE=$(word 2,$(m$*)) \
+ ${SHELL} $< >$@
+m%-rom-hosted.ld : cf.sc Makefile
+ IO=hosted RAM=$(word 1,$(m$*)) RAM_SIZE=$(word 2,$(m$*)) \
+ ROM=$(word 3,$(m$*)) ROM_SIZE=$(word 4,$(m$*)) ${SHELL} $< >$@
leds.o: ${srcdir}/leds.c
- $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -c $<
idp-inbyte.o: ${srcdir}/idp-inbyte.c
- $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -c $<
idp-outbyte.o: ${srcdir}/idp-outbyte.c
- $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -c $<
idp-gdb-outbyte.o: ${srcdir}/idp-outbyte.c
- $(CC) $(CFLAGS_FOR_TARGET) -DGDB_MONITOR_OUTPUT $(INCLUDES) -c $< -o $@
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) -DGDB_MONITOR_OUTPUT $(INCLUDES) -c $< -o $@
mc68ec.o: ${srcdir}/mc68ec.c
- $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -c $<
test.o: ${srcdir}/test.c
@@ -250,7 +278,7 @@ test: $(OBJS) idp-test.srec mvme135-test.srec bcc-test.srec \
# symbols will get fully resolved.
idp-test.x: test.o ${CRT0} Makefile ${IDP_BSP}
- ${CC} $(CFLAGS_FOR_TARGET) -L${srcdir} -L${objdir} \
+ ${CC} $(CFLAGS_FOR_TARGET) $(CFLAGS) -L${srcdir} -L${objdir} \
test.o -o $@ $(LDFLAGS_FOR_TARGET) -N -Wl,-Tidp.ld
idp-test.srec: idp-test.x
$(OBJCOPY) -O srec idp-test.x $@
@@ -260,7 +288,7 @@ idp-test.dis: idp-test.x
idp-test: idp-test.srec idp-test.dis
idpgdb-test.x: test.o ${CRT0} Makefile ${IDPGDB_BSP}
- ${CC} $(CFLAGS_FOR_TARGET) -L${srcdir} -L${objdir} \
+ ${CC} $(CFLAGS_FOR_TARGET) $(CFLAGS) -L${srcdir} -L${objdir} \
test.o -o $@ $(LDFLAGS_FOR_TARGET) -N -Wl,-Tidpgdb.ld
idpgdb-test.srec: idpgdb-test.x
$(OBJCOPY) -O srec idpgdb-test.x $@
@@ -301,7 +329,7 @@ bcc-test: bcc-test.srec bcc-test.dis
# a C++ test case
dtor.o: $(srcdir)/dtor.C
- $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -o $@ -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -o $@ -c $<
dtor.dis: dtor.x
@rm -fr dtor.dis
$(OBJDUMP) -d dtor.x > $@
@@ -312,7 +340,11 @@ dtor.x: dtor.o ${CRT0} ${srcdir}/mvme135.ld Makefile ${MVME135_BSP}
unlink.o: $(srcdir)/../unlink.c
.PHONY: install info dvi doc install-info clean-info
-install:
+install:: $(DO:%=install_%)
+
+
+.PHONY:install_m68k
+install_m68k::
# install SIM stuff
$(INSTALL_PROGRAM) $(SIM_CRT0) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(SIM_CRT0)
$(INSTALL_PROGRAM) $(SIM_BSP) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(SIM_BSP)
@@ -334,15 +366,28 @@ install:
# install MVME162lx stuff
$(INSTALL_PROGRAM) $(MVME162_BSP) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(MVME162_BSP)
$(INSTALL_DATA) ${srcdir}/mvme162.ld $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/mvme162.ld
- # install BDM stuff
- $(INSTALL_PROGRAM) $(BDM_CRT0) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(BDM_CRT0)
- $(INSTALL_PROGRAM) $(BDM_BSP) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(BDM_BSP)
-
$(INSTALL_DATA) ${srcdir}/sbc5204.ld $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/sbc5204.ld
$(INSTALL_DATA) ${srcdir}/sbc5206.ld $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/sbc5206.ld
+
+.PHONY: install_cf
+install_cf:: install_io
+ # install CF stuff
+ for crt in $(CF_CRT0S) ; \
+ do $(INSTALL_DATA) $$crt $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$$crt ; \
+ done
+ $(INSTALL_DATA) $(CF_BSP) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(CF_BSP)
for script in $(CF_SCRIPTS) ; \
do $(INSTALL_DATA) $$script $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$$script ; \
done
+ for src in $(CF_SOURCES) ; \
+ do $(INSTALL_DATA) ${srcdir}/$$src $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$$src ; \
+ done
+
+.PHONY: install_io
+install_io::
+ # install IO stuff
+ $(INSTALL_DATA) $(HOSTED_BSP) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(HOSTED_BSP)
+ $(INSTALL_DATA) $(UNHOSTED_BSP) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(UNHOSTED_BSP)
# target specific makefile fragment comes in here.
@target_makefile_frag@