summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
Diffstat (limited to 'c')
-rw-r--r--c/Makefile.am1
-rw-r--r--c/configure.in2
-rw-r--r--c/make/Makefile.am17
-rw-r--r--c/make/configure.in59
-rw-r--r--c/make/target.cfg.in (renamed from c/src/make/target.cfg.in)4
-rw-r--r--c/src/make/Makefile.am4
-rw-r--r--c/src/make/bsp.cfg.in4
-rw-r--r--c/src/make/compilers/gcc-target-default.cfg23
-rw-r--r--c/src/make/configure.in1
-rw-r--r--c/src/make/custom/default.cfg.in10
-rw-r--r--c/src/make/main.cfg.in10
-rw-r--r--c/src/tests/samples/cdtest/Makefile.in2
-rw-r--r--c/src/tests/samples/paranoia/Makefile.in2
13 files changed, 102 insertions, 37 deletions
diff --git a/c/Makefile.am b/c/Makefile.am
index d5ef7eb128..949c8171d7 100644
--- a/c/Makefile.am
+++ b/c/Makefile.am
@@ -12,6 +12,7 @@ RTEMS_BSP = $(RTEMS_BSP_LIST)
## The '.' in SUBDIRS ensures that local make-targets (xxx-am) will be
## triggered before $(RTEMS_BSP_LIST) subdirectories are made.
SUBDIRS= \
+make \
. \
$(RTEMS_BSP)
diff --git a/c/configure.in b/c/configure.in
index 60f92356da..2df416b8b4 100644
--- a/c/configure.in
+++ b/c/configure.in
@@ -98,6 +98,8 @@ AC_SUBST(rtems_bsp_configure)
AC_SUBST(RTEMS_BSP_LIST)
+AC_CONFIG_SUBDIRS(make)
+
AC_OUTPUT(
Makefile
)
diff --git a/c/make/Makefile.am b/c/make/Makefile.am
new file mode 100644
index 0000000000..b1d7b6367f
--- /dev/null
+++ b/c/make/Makefile.am
@@ -0,0 +1,17 @@
+##
+## $Id$
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
+
+rtems_makedir=$(prefix)/make
+
+GENERIC_FILES = \
+target.cfg
+
+rtems_make_DATA = \
+$(GENERIC_FILES)
+
+include $(top_srcdir)/../../automake/subdirs.am
+include $(top_srcdir)/../../automake/local.am
diff --git a/c/make/configure.in b/c/make/configure.in
new file mode 100644
index 0000000000..9f1b3ec83c
--- /dev/null
+++ b/c/make/configure.in
@@ -0,0 +1,59 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl $Id$
+
+dnl
+dnl This script configures the configuration files below c/make/
+dnl
+
+AC_PREREQ(2.13)
+AC_INIT(target.cfg.in)
+RTEMS_TOP(../..)
+AC_CONFIG_AUX_DIR(../..)
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE(rtems-c-make,$RTEMS_VERSION,no)
+AM_MAINTAINER_MODE
+
+RTEMS_ENABLE_MULTIPROCESSING
+RTEMS_ENABLE_POSIX
+RTEMS_ENABLE_NETWORKING
+RTEMS_ENABLE_RDBG
+RTEMS_ENABLE_INLINES
+RTEMS_ENABLE_CXX
+RTEMS_ENABLE_GCC28
+RTEMS_ENABLE_LIBCDIR
+
+RTEMS_CHECK_CPU
+RTEMS_CANONICAL_HOST
+
+RTEMS_PROJECT_ROOT
+
+dnl check target cc
+RTEMS_PROG_CC_FOR_TARGET
+
+dnl check for g++
+if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
+ RTEMS_PROG_CXX_FOR_TARGET
+fi
+
+RTEMS_CANONICALIZE_TOOLS
+
+AC_SUBST(rtems_cv_prog_cc_cross)
+AC_SUBST(RTEMS_HAS_POSIX)
+AC_SUBST(RTEMS_HOST)
+AC_SUBST(RTEMS_HAS_MULTIPROCESSING)
+AC_SUBST(RTEMS_HAS_POSIX_API)
+AC_SUBST(RTEMS_HAS_NETWORKING)
+AC_SUBST(RTEMS_HAS_RDBG)
+AC_SUBST(RTEMS_HAS_CPLUSPLUS)
+AC_SUBST(RTEMS_USE_MACROS)
+AC_SUBST(RTEMS_USE_GCC272)
+AC_SUBST(RTEMS_LIBC_DIR)
+AC_SUBST(RTEMS_CPU)
+
+AC_OUTPUT(
+Makefile
+target.cfg
+)
diff --git a/c/src/make/target.cfg.in b/c/make/target.cfg.in
index a49cf8a8e3..4fa72f6ed8 100644
--- a/c/src/make/target.cfg.in
+++ b/c/make/target.cfg.in
@@ -48,10 +48,6 @@ RTEMS_USE_GCC272 = @RTEMS_USE_GCC272@
RTEMS_LIBC_DIR = @RTEMS_LIBC_DIR@
RTEMS_CPU = @RTEMS_CPU@
-# the following are only used for the bare bsp
-BARE_CPU_MODEL = @BARE_CPU_MODEL@
-BARE_CPU_CFLAGS = @BARE_CPU_CFLAGS@
-
XCFLAGS=$(CFLAGS_FOR_TARGET)
export RTEMS_BSP
diff --git a/c/src/make/Makefile.am b/c/src/make/Makefile.am
index 2ea706e37a..a149c4a3ac 100644
--- a/c/src/make/Makefile.am
+++ b/c/src/make/Makefile.am
@@ -8,7 +8,7 @@ ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
rtems_makedir=$(prefix)/make
GENERIC_FILES = \
-host.cfg target.cfg
+host.cfg
MAKE_FILES = README \
directory.cfg leaf.cfg \
@@ -37,8 +37,6 @@ $(srcdir)/main.cfg.in: $(top_srcdir)/@RTEMS_TOPdir@/make/main.cfg
$(srcdir)/host.cfg.in: $(top_srcdir)/@RTEMS_TOPdir@/make/host.cfg.in
cp $< $@
-$(srcdir)/target.cfg.in: $(top_srcdir)/@RTEMS_TOPdir@/make/target.cfg.in
- cp $< $@
endif
SUBDIRS = compilers custom
diff --git a/c/src/make/bsp.cfg.in b/c/src/make/bsp.cfg.in
index e0ddae8cda..12d64f3890 100644
--- a/c/src/make/bsp.cfg.in
+++ b/c/src/make/bsp.cfg.in
@@ -29,3 +29,7 @@ HAS_CPLUSPLUS = @HAS_CPLUSPLUS@
## Does this BSP support RTEMS's networking ?
##
HAS_NETWORKING = @HAS_NETWORKING@
+
+## Only used for the bare bsp
+BARE_CPU_MODEL = @BARE_CPU_MODEL@
+BARE_CPU_CFLAGS = @BARE_CPU_CFLAGS@
diff --git a/c/src/make/compilers/gcc-target-default.cfg b/c/src/make/compilers/gcc-target-default.cfg
index 529bc4b742..f91c2a6e31 100644
--- a/c/src/make/compilers/gcc-target-default.cfg
+++ b/c/src/make/compilers/gcc-target-default.cfg
@@ -82,7 +82,7 @@ endif
# Define this to yes if C++ is included in the development environment.
# This requires that at least the GNU C++ compiler and libg++ be installed.
-ifeq ($(RTEMS_HAS_CPLUSPLUS),yes)
+ifeq ($(HAS_CPLUSPLUS),yes)
CPLUS_LD_LIBS += $(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA)
endif
@@ -172,13 +172,15 @@ MKLIB=$(RANLIB)
#
# How to compile stuff into ${ARCH} subdirectory
#
+# OBSOLETE: we use make's default rules now
+#
# NOTE: we override COMPILE.[c|cc|S]
# because gmake default rules use TARGET_ARCH for different purposes
#
-
-COMPILE.c=$(CC) $(CPPFLAGS) $(CFLAGS) -c
-COMPILE.cc=$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c
-COMPILE.S=$(CC) $(ASFLAGS) $(CPPFLAGS) -c
+#
+# COMPILE.c=$(CC) $(CPPFLAGS) $(CFLAGS) -c
+# COMPILE.cc=$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c
+# COMPILE.S=$(CC) $(ASFLAGS) $(CPPFLAGS) -c
${ARCH}/%.o: %.c
${COMPILE.c} -o $@ $<
@@ -198,13 +200,6 @@ ${ARCH}/%.o: %.C
${ARCH}/%.o: %.S
${COMPILE.S} -DASM -o $@ $<
-# OBSOLETE: the rule above should be equivalent.
-# strip out C++ style comments.
-# ${ARCH}/%.o: %.S
-# sed -e 's/\/\/.*$$//' < $< | \
-# $(CPP) $(CPPFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i
-# $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
-
# Make foo.rel from foo.o
${ARCH}/%.rel: ${ARCH}/%.o
${LD} $(LDFLAGS_INCOMPLETE) -o $@ $^
@@ -216,10 +211,10 @@ ${ARCH}/%: %.sh
$(CHMOD) +x $@
# Dependency files for use by gmake
-# NOTE: we don't put in $(TARGET_ARCH)
+# NOTE: we don't put them into $(ARCH)
# so that 'make clean' doesn't blow it away
-DEPEND=Depends-$(TARGET_ARCH:o-%=%)
+DEPEND=Depends-${ARCH}
CLEAN_DEPEND=$(DEPEND).tmp
CLOBBER_DEPEND=$(DEPEND)
diff --git a/c/src/make/configure.in b/c/src/make/configure.in
index 3047f719e2..3ccd3b7387 100644
--- a/c/src/make/configure.in
+++ b/c/src/make/configure.in
@@ -124,7 +124,6 @@ Makefile
Makefile.inc
main.cfg
host.cfg
-target.cfg
bsp.cfg
custom/Makefile
custom/default.cfg
diff --git a/c/src/make/custom/default.cfg.in b/c/src/make/custom/default.cfg.in
index aaf1507538..7f6f5e51a9 100644
--- a/c/src/make/custom/default.cfg.in
+++ b/c/src/make/custom/default.cfg.in
@@ -8,20 +8,14 @@
# $Id$
#
-include $(RTEMS_ROOT)/make/target.cfg
+include $(RTEMS_ROOT)/../make/target.cfg
include $(RTEMS_ROOT)/make/host.cfg
-# Specify here the host and target "architectures"
-HOST_ARCH=o-$(RTEMS_HOST)
-ifndef TARGET_ARCH
-TARGET_ARCH=o-@RTEMS_BSP@
-endif
-
include $(RTEMS_ROOT)/make/main.cfg
include $(RTEMS_ROOT)/make/bsp.cfg
## Target compiler config file, if any
-CONFIG.$(TARGET_ARCH).CC = $(RTEMS_ROOT)/make/compilers/gcc-target-default.cfg
+CONFIG.CC = $(RTEMS_ROOT)/make/compilers/gcc-target-default.cfg
## GCC specs extension file location
RTEMS_BSP_SPECS = $(PROJECT_ROOT)/@RTEMS_BSP@/lib/bsp_specs
diff --git a/c/src/make/main.cfg.in b/c/src/make/main.cfg.in
index 9122a0a75c..664b496d6f 100644
--- a/c/src/make/main.cfg.in
+++ b/c/src/make/main.cfg.in
@@ -17,11 +17,11 @@ PROJECT_INCLUDE=$(PROJECT_RELEASE)/lib/include
PROJECT_TOOLS = $(PROJECT_RELEASE)/build-tools
#
-# Target architecture; may be changed as per 'make "ARCH=${TARGET_ARCH}-debug"'
+# Target architecture; may be changed as per 'make "ARCH=debug"'
# This is where the object files get put.
#
-ARCH=${TARGET_ARCH}
+ARCH=o-optimize
VARIANT=
@@ -43,12 +43,12 @@ MAKEFILE=Makefile
#
# Target variant names
#
-TARGET_VARIANTS = debug profile
+TARGET_VARIANTS = optimize debug profile
#
-# Generate list of object directories: sun4, sun4-debug, sun4-profile
+# Generate list of object directories: o-optimize, o-debug, o-profile
#
-VARIANTS=${TARGET_ARCH} ${TARGET_VARIANTS:%=${TARGET_ARCH}-%}
+VARIANTS=${TARGET_VARIANTS:%=o-%}
#
# List of "recursion-able" targets for directory Makefiles
diff --git a/c/src/tests/samples/cdtest/Makefile.in b/c/src/tests/samples/cdtest/Makefile.in
index 71da922768..39fb1ed0f4 100644
--- a/c/src/tests/samples/cdtest/Makefile.in
+++ b/c/src/tests/samples/cdtest/Makefile.in
@@ -50,7 +50,7 @@ PACKHEX = @PACKHEX@
#
DEFINES +=
-CPPFLAGS += -I$(LIBCC_INCLUDE)
+CPPFLAGS +=
CFLAGS +=
LD_PATHS +=
diff --git a/c/src/tests/samples/paranoia/Makefile.in b/c/src/tests/samples/paranoia/Makefile.in
index b00435434e..24e689f7cd 100644
--- a/c/src/tests/samples/paranoia/Makefile.in
+++ b/c/src/tests/samples/paranoia/Makefile.in
@@ -52,7 +52,7 @@ CPPFLAGS +=
CFLAGS +=
LD_PATHS +=
-LD_LIBS += $(LIBC_LIBM)
+LD_LIBS += -lm
LDFLAGS +=
#