summaryrefslogtreecommitdiff
path: root/support/regression/ports/host
diff options
context:
space:
mode:
Diffstat (limited to 'support/regression/ports/host')
-rw-r--r--support/regression/ports/host/spec.mk38
-rw-r--r--support/regression/ports/host/spec.mk.in38
-rw-r--r--support/regression/ports/host/support.c21
3 files changed, 97 insertions, 0 deletions
diff --git a/support/regression/ports/host/spec.mk b/support/regression/ports/host/spec.mk
new file mode 100644
index 0000000..650af25
--- /dev/null
+++ b/support/regression/ports/host/spec.mk
@@ -0,0 +1,38 @@
+# Port specification for compiling on the host machines version of gcc
+SDCC = gcc
+SDCCFLAGS = -pipe -ggdb -g -O2 --std=c99 $(CPPFLAGS) -DPORT_HOST=1 -DREENTRANT= -I$(top_builddir) -I$(top_srcdir)
+SDLDFLAGS =
+# disable all warnings:
+SDCCFLAGS+= -w
+# enable all warnings:
+#SDCCFLAGS+= -Wall -Wno-parentheses
+
+BINEXT = .bin
+OBJEXT = .o
+INC_DIR = .
+
+# otherwise `make` deletes testfwk.o and `make -j` will fail
+.PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT)
+
+# Required extras
+EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
+include $(srcdir)/fwk/lib/spec.mk
+
+%.out: %$(BINEXT)
+ mkdir -p $(dir $@)
+ -$< > $@
+ -grep -n FAIL $@ /dev/null || true
+
+%$(BINEXT): %$(OBJEXT) $(EXTRAS) $(FWKLIB)
+ $(SDCC) $(SDCCFLAGS) $(SDLDFLAGS) -o $@ $< $(EXTRAS) $(FWKLIB) -lm
+
+%$(OBJEXT): %.c
+ $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
+ $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/%$(OBJEXT): $(srcdir)/fwk/lib/%.c
+ $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+_clean:
diff --git a/support/regression/ports/host/spec.mk.in b/support/regression/ports/host/spec.mk.in
new file mode 100644
index 0000000..41ec8a0
--- /dev/null
+++ b/support/regression/ports/host/spec.mk.in
@@ -0,0 +1,38 @@
+# Port specification for compiling on the host machines version of gcc
+SDCC = @CC@
+SDCCFLAGS = @CFLAGS@ @C99_FLAG@ $(CPPFLAGS) -DPORT_HOST=1 -DREENTRANT= -I$(top_builddir) -I$(top_srcdir)
+SDLDFLAGS = @LDFLAGS@
+# disable all warnings:
+SDCCFLAGS+= -w
+# enable all warnings:
+#SDCCFLAGS+= @WALL_FLAG@
+
+BINEXT = .bin
+OBJEXT = .o
+INC_DIR = .
+
+# otherwise `make` deletes testfwk.o and `make -j` will fail
+.PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT)
+
+# Required extras
+EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
+include $(srcdir)/fwk/lib/spec.mk
+
+%.out: %$(BINEXT)
+ mkdir -p $(dir $@)
+ -$< > $@
+ -grep -n FAIL $@ /dev/null || true
+
+%$(BINEXT): %$(OBJEXT) $(EXTRAS) $(FWKLIB)
+ $(SDCC) $(SDCCFLAGS) $(SDLDFLAGS) -o $@ $< $(EXTRAS) $(FWKLIB) -lm
+
+%$(OBJEXT): %.c
+ $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
+ $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/%$(OBJEXT): $(srcdir)/fwk/lib/%.c
+ $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+_clean:
diff --git a/support/regression/ports/host/support.c b/support/regression/ports/host/support.c
new file mode 100644
index 0000000..3921b47
--- /dev/null
+++ b/support/regression/ports/host/support.c
@@ -0,0 +1,21 @@
+/** Host specific support routines.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+
+void
+_putchar(char c)
+{
+ putchar(c);
+}
+
+void
+_initEmu(void)
+{
+}
+
+void
+_exitEmu(void)
+{
+ exit(0);
+}