Commit 224c30b4 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

No reason for separation of sources in FPU/NONFPU ones

parent e493c6bf
......@@ -28,28 +28,29 @@ CROSS_PREFIX=sparc-rtems4.11
#endif
# The directories containing the source files, separated by ':'
#
# DEAR USER, YOU MUST EDIT THIS
VPATH=src
# Your source files: regardless of where they reside in the source tree,
# VPATH will locate them...
NONFPU_SRC= \
#
# DEAR USER, YOU MUST EDIT THIS
SRC= \
init.c \
task1.c \
task2.c
# Code that must be compiled with native FPU enabled (when FPU=1 is passed)
FPU_SRC= \
task1.c
SUFFIX=$(CFG).$(FPU_SUFFIX).$(LEON)
# Build a Dependency list and an Object list, by replacing the .c
# extension to .d for dependency files, and .o for object files.
NONFPU_DEP = $(patsubst %.c, deps.$(SUFFIX)/NONFPU_%.d, ${NONFPU_SRC})
FPU_DEP = $(patsubst %.c, deps.$(SUFFIX)/FPU_%.d, ${FPU_SRC})
NONFPU_OBJ = $(patsubst %.c, objs.$(SUFFIX)/NONFPU_%.o, ${NONFPU_SRC})
FPU_OBJ = $(patsubst %.c, objs.$(SUFFIX)/FPU_%.o, ${FPU_SRC})
DEP = $(patsubst %.c, deps.$(SUFFIX)/%.d, ${SRC})
OBJ = $(patsubst %.c, objs.$(SUFFIX)/%.o, ${SRC})
# Your final binary
#
# DEAR USER, YOU MUST EDIT THIS
TARGET=fputest
# What compiler to use for generating dependencies:
......@@ -74,12 +75,9 @@ else
CFLAGS += ${COMMON} -g -O2 ${INCLUDEFLAGS}
endif
# Should we generate native FPU instructions for the FPU_SRC?
ifeq ($(FPU),1)
CFLAGS_FPU:=${CFLAGS}
else
# Should we generate native FPU instructions for the SRC or not?
ifeq ($(FPU),0)
CFLAGS += -msoft-float
CFLAGS_FPU:=${CFLAGS}
LDFLAGS += -msoft-float
endif
......@@ -108,7 +106,7 @@ endif
endif
bin.$(SUFFIX)/${TARGET}: ${NONFPU_OBJ} ${FPU_OBJ} | inform
bin.$(SUFFIX)/${TARGET}: ${OBJ} | inform
@mkdir -p $(dir $@)
ifeq ($(V),1)
$(CC) -g -o $@ $^ ${LDFLAGS}
......@@ -122,7 +120,7 @@ ifeq ($(CFG),release)
endif
@echo Built with RTEMS at ${RTEMS_LIB} for ${LEON}.
objs.$(SUFFIX)/NONFPU_%.o: %.c
objs.$(SUFFIX)/%.o: %.c
@mkdir -p $(dir $@)
ifeq ($(V),1)
$(CC) -c $(CFLAGS) -o $@ $<
......@@ -131,27 +129,11 @@ else
@$(CC) -c $(CFLAGS) -o $@ $<
endif
objs.$(SUFFIX)/FPU_%.o: %.c
@mkdir -p $(dir $@)
ifeq ($(V),1)
$(CC) -c $(CFLAGS_FPU) -o $@ $<
else
@echo [CC] $@
@$(CC) -c $(CFLAGS_FPU) -o $@ $<
endif
deps.$(SUFFIX)/NONFPU_%.d: %.c
@mkdir -p $(dir $@)
@echo Generating dependencies for $<
@set -e ; $(CDEP) -MM -MP $(INCLUDEFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,objs.$(CFG)\/NONFPU_\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
deps.$(SUFFIX)/FPU_%.d: %.c
deps.$(SUFFIX)/%.d: %.c
@mkdir -p $(dir $@)
@echo Generating dependencies for $<
@set -e ; $(CDEP) -MM -MP $(INCLUDEFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,objs.$(CFG)\/NONFPU_\1.o $@ : ,g' < $@.$$$$ > $@; \
sed 's,\($*\)\.o[ :]*,objs.$(CFG)\/\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
clean:
......@@ -161,6 +143,5 @@ clean:
# which are auto-generated. Don't fail if they are missing
# (-include), since they will be missing in the first invocation!
ifneq ($(MAKECMDGOALS),clean)
-include ${NONFPU_DEP}
-include ${FPU_DEP}
-include ${DEP}
endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment