summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/examples/nxflat/tests/Make.defs3
-rw-r--r--nuttx/examples/nxflat/tests/errno/Makefile4
-rw-r--r--nuttx/examples/nxflat/tests/hello++/Makefile34
-rw-r--r--nuttx/examples/nxflat/tests/hello/Makefile4
-rw-r--r--nuttx/examples/nxflat/tests/longjmp/Makefile4
-rw-r--r--nuttx/examples/nxflat/tests/mutex/Makefile4
-rw-r--r--nuttx/examples/nxflat/tests/pthread/Makefile4
-rw-r--r--nuttx/examples/nxflat/tests/signal/Makefile27
-rw-r--r--nuttx/examples/nxflat/tests/task/Makefile4
9 files changed, 52 insertions, 36 deletions
diff --git a/nuttx/examples/nxflat/tests/Make.defs b/nuttx/examples/nxflat/tests/Make.defs
index b0c035d0b..ee0b4cb94 100644
--- a/nuttx/examples/nxflat/tests/Make.defs
+++ b/nuttx/examples/nxflat/tests/Make.defs
@@ -41,5 +41,6 @@ NXFLATCC = $(CC)
NXFLATCFLAGS = $(CFLAGS)
NXFLATLD = $(LD)
-NXFLATLDFLAGS = -e main
+NXFLATLDFLAGS1 = -e main
+NXFLATLDFLAGS2 = -e main -T $(TOPDIR)/examples/nxflat/nxflat.ld -no-check-sections
diff --git a/nuttx/examples/nxflat/tests/errno/Makefile b/nuttx/examples/nxflat/tests/errno/Makefile
index 6a351b96f..ad409e758 100644
--- a/nuttx/examples/nxflat/tests/errno/Makefile
+++ b/nuttx/examples/nxflat/tests/errno/Makefile
@@ -54,13 +54,13 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
$(BIN).r2: $(R2OBJ)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
touch $(BIN) # For now
diff --git a/nuttx/examples/nxflat/tests/hello++/Makefile b/nuttx/examples/nxflat/tests/hello++/Makefile
index 5fb39b0e7..6d8388f23 100644
--- a/nuttx/examples/nxflat/tests/hello++/Makefile
+++ b/nuttx/examples/nxflat/tests/hello++/Makefile
@@ -44,22 +44,22 @@ BIN3 = hello++3
ALL_BIN = $(BIN1) $(BIN2) $(BIN3) $(BIN4)
R1SRCS1 = $(BIN1).c
-OBJS1 = $(R1SRCS1:.c=.o)
+R1OBJS1 = $(R1SRCS1:.c=.o)
R2SRC1 = $(BIN1)-thunk.S
R2OBJ1 = $(R2SRC1:.S=.o)
R1SRCS2 = $(BIN2).c
-OBJS2 = $(R1SRCS2:.c=.o)
+R1OBJS2 = $(R1SRCS2:.c=.o)
R2SRC2 = $(BIN2)-thunk.S
R2OBJ2 = $(R2SRC2:.S=.o)
R1SRCS3 = $(BIN3).c
-OBJS3 = $(R1SRCS3:.c=.o)
+R1OBJS3 = $(R1SRCS3:.c=.o)
R2SRC3 = $(BIN3)-thunk.S
R2OBJ3 = $(R2SRC3:.S=.o)
#R1SRCS4 = $(BIN4).c
-#OBJS4 = $(R1SRCS4:.c=.o)
+#R1OBJS4 = $(R1SRCS4:.c=.o)
#R2SRC4 = $(BIN4)-thunk.S
#R2OBJ4 = $(R2SRC4:.S=.o)
@@ -90,26 +90,26 @@ $(LIBSTDC_STUBS_LIB):
# BIN2 contains a class that implements hello world, but it is
# not statically initialized.
-$(BIN1).r1: $(OBJS1)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+$(BIN1).r1: $(R1OBJS1)
+ $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC1): $(BIN1).r1
$(MKNXFLAT) -o $@ $^
$(BIN1).r2: $(R2OBJ1)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS1) $(R2OBJ1)
$(BIN1): $(BIN1).r2
touch $(BIN1) # For now
-$(BIN2).r1: $(OBJS2) $(LIBSTDC_STUBS_LIB)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+$(BIN2).r1: $(R1OBJS2) $(LIBSTDC_STUBS_LIB)
+ $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC2): $(BIN2).r1
$(MKNXFLAT) -o $@ $^
$(BIN2).r2: $(R2OBJ2)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS2) $(R2OBJ2)
(BIN2): $(BIN2).r2
touch $(BIN2) # For now
@@ -120,14 +120,14 @@ $(BIN2).r2: $(R2OBJ2)
#
# BIN3 is equivalent to BIN2 except that is uses static initializers
-$(BIN3).r1: $(OBJS3) $(LIBSTDC_STUBS_LIB)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+$(BIN3).r1: $(R1OBJS3) $(LIBSTDC_STUBS_LIB)
+ $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
-$(R2SRC3): $(BI3N).r1
+$(R2SRC3): $(BIN3).r1
$(MKNXFLAT) -o $@ $^
$(BIN3).r2: $(R2OBJ3)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS3) $(R2OBJ3)
$(BIN3): $(BIN3).r2
touch $(BIN3) # For now
@@ -136,14 +136,14 @@ $(BIN3): $(BIN3).r2
#
# NOTE: libstdc++ is not available for XFLAT as of this writing
#
-#$(BIN4).r1: $(OBJS4) $(LIBSTDC_STUBS_LIB)
-# $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+#$(BIN4).r1: $(R1OBJS4) $(LIBSTDC_STUBS_LIB)
+# $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
#
#$(R2SRC4): $(BIN4).r1
# $(MKNXFLAT) -o $@ $^
#
#$(BIN4).r2: $(R2OBJ4)
-# $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+# $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS4) $(R2OBJ4)
#
#$(BIN4): $(BIN4).r2
# touch $(BIN4) # For now
diff --git a/nuttx/examples/nxflat/tests/hello/Makefile b/nuttx/examples/nxflat/tests/hello/Makefile
index 1f5327a60..80912c075 100644
--- a/nuttx/examples/nxflat/tests/hello/Makefile
+++ b/nuttx/examples/nxflat/tests/hello/Makefile
@@ -54,13 +54,13 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
$(BIN).r2: $(R2OBJ)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
touch $(BIN) # For now
diff --git a/nuttx/examples/nxflat/tests/longjmp/Makefile b/nuttx/examples/nxflat/tests/longjmp/Makefile
index fa2dd05c2..fcca4c827 100644
--- a/nuttx/examples/nxflat/tests/longjmp/Makefile
+++ b/nuttx/examples/nxflat/tests/longjmp/Makefile
@@ -54,13 +54,13 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
$(BIN).r2: $(R2OBJ)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
touch $(BIN) # For now
diff --git a/nuttx/examples/nxflat/tests/mutex/Makefile b/nuttx/examples/nxflat/tests/mutex/Makefile
index 8e0254d3e..e52bcfb48 100644
--- a/nuttx/examples/nxflat/tests/mutex/Makefile
+++ b/nuttx/examples/nxflat/tests/mutex/Makefile
@@ -54,13 +54,13 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
$(BIN).r2: $(R2OBJ)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
touch $(BIN) # For now
diff --git a/nuttx/examples/nxflat/tests/pthread/Makefile b/nuttx/examples/nxflat/tests/pthread/Makefile
index 785c9804f..c4ffbd7c7 100644
--- a/nuttx/examples/nxflat/tests/pthread/Makefile
+++ b/nuttx/examples/nxflat/tests/pthread/Makefile
@@ -54,13 +54,13 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
$(BIN).r2: $(R2OBJ)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
touch $(BIN) # For now
diff --git a/nuttx/examples/nxflat/tests/signal/Makefile b/nuttx/examples/nxflat/tests/signal/Makefile
index e1632aa8f..197a410e6 100644
--- a/nuttx/examples/nxflat/tests/signal/Makefile
+++ b/nuttx/examples/nxflat/tests/signal/Makefile
@@ -39,19 +39,34 @@ include ../Make.defs # NXFLAT make info
BIN = signal
-SRCS = $(BIN).c
-OBJS = $(SRCS:.c=.o)
+R1SRCS = $(BIN).c
+R1OBJS = $(R1SRCS:.c=.o)
+
+R2SRC = $(BIN)-thunk.S
+R2OBJ = $(R2SRC:.S=.o)
all: $(BIN)
-$(OBJS): %.o: %.c
+$(R1OBJS): %.o: %.c
+ $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
+
+$(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
-$(BIN): $(OBJS)
- $(NXFLATLD) $(NXFLATLDFLAGS) -o $@ $(OBJS)
+$(BIN).r1: $(R1OBJS)
+ $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
+
+$(R2SRC): $(BIN).r1
+ $(MKNXFLAT) -o $@ $^
+
+$(BIN).r2: $(R2OBJ)
+ $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
+
+$(BIN): $(BIN).r2
+ touch $(BIN) # For now
clean:
- rm -f $(BIN) *.o core
+ rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core
install:
install -D $(BIN) $(ROMFS_DIR)/$(BIN)
diff --git a/nuttx/examples/nxflat/tests/task/Makefile b/nuttx/examples/nxflat/tests/task/Makefile
index c57088375..6fe0bd3e6 100644
--- a/nuttx/examples/nxflat/tests/task/Makefile
+++ b/nuttx/examples/nxflat/tests/task/Makefile
@@ -54,13 +54,13 @@ $(R2OBJ): %.o: %.S
$(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@
$(BIN).r1: $(R1OBJS)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^
$(R2SRC): $(BIN).r1
$(MKNXFLAT) -o $@ $^
$(BIN).r2: $(R2OBJ)
- $(NXFLATLD) -r $(NXFLATLDFLAGS) -o $@ $^
+ $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
$(BIN): $(BIN).r2
touch $(BIN) # For now