summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavi Del Campo <xavi.dcr@tutanota.com>2019-11-05 17:56:35 +0100
committerXavi Del Campo <xavi.dcr@tutanota.com>2019-11-05 17:56:35 +0100
commite524f157266c07a7a4cf3b766edd6ff9db98e4f4 (patch)
tree3dcbf507b5ec87d297f833df79cb532c3844032f /src
parent1dcefbf527e52315abfe3b4871272b3fd9bb0f4b (diff)
downloadsdcc-gas-e524f157266c07a7a4cf3b766edd6ff9db98e4f4.tar.gz
Removed intermediate files
Diffstat (limited to 'src')
-rw-r--r--src/Makefile153
-rw-r--r--src/Makefile.in4
-rw-r--r--src/pdk/Makefile.dep45
-rw-r--r--src/pdk/gen.obin538800 -> 0 bytes
-rw-r--r--src/pdk/main.obin85464 -> 0 bytes
-rw-r--r--src/pdk/peep.obin117680 -> 0 bytes
-rw-r--r--src/pdk/peeph.rul58
-rw-r--r--src/pdk/ralloc.obin128192 -> 0 bytes
-rw-r--r--src/pdk/ralloc2.obin12156320 -> 0 bytes
-rw-r--r--src/regression/Makefile226
10 files changed, 381 insertions, 105 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..3cc5b4b
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,153 @@
+#
+#
+#
+
+srcdir = .
+top_srcdir = ..
+top_builddir = ..
+
+
+include $(top_builddir)/Makefile.common
+
+USE_ALT_LEX = 0
+
+PORTS = $(shell cat ../ports.build)
+ALLPORTS = $(shell cat ../ports.all)
+PORT_LIBS = $(PORTS:%=%/port.a)
+
+LIBS = -lm
+
+CFLAGS = -pipe -ggdb -g -Og -Wall -Wno-parentheses
+CXXFLAGS = -pipe -ggdb -g -Og -Wall -Wno-parentheses
+CPPFLAGS += -I$(srcdir)
+LDFLAGS =
+
+ifdef SDCC_SUB_VERSION
+CFLAGS += -DSDCC_SUB_VERSION_STR=\"$(SDCC_SUB_VERSION)\"
+endif
+
+SLIBOBJS = NewAlloc.o dbuf.o dbuf_string.o findme.o
+
+OBJECTS = SDCCy.o SDCChasht.o SDCCmain.o \
+ SDCCsymt.o SDCCopt.o SDCCast.o SDCCmem.o SDCCval.o \
+ SDCCicode.o SDCCbitv.o SDCCset.o SDCClabel.o \
+ SDCCBBlock.o SDCCloop.o SDCCcse.o SDCCcflow.o SDCCdflow.o \
+ SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o \
+ SDCCasm.o SDCCmacro.o SDCCutil.o SDCCdebug.o cdbFile.o SDCCdwarf2.o\
+ SDCCerr.o SDCCsystem.o SDCCgen.o
+
+SPECIAL = SDCCy.h
+ifeq ($(USE_ALT_LEX), 1)
+OBJECTS += altlex.o
+SPECIAL += reswords.h
+else
+OBJECTS += SDCClex.o
+endif
+
+SLIBSOURCES = $(patsubst %.o,$(SLIB)/%.c,$(SLIBOBJS))
+SOURCES := $(patsubst %.o,%.c,$(OBJECTS))
+
+# C++ sources (.cc extension)
+CXXSOURCES += $(sort $(notdir $(wildcard $(srcdir)/*.cc)))
+OBJECTS += $(patsubst %.cc,%.o,$(CXXSOURCES))
+
+TARGET = $(top_builddir)/bin/sdcc$(EXEEXT)
+
+# Compiling entire program or any subproject
+# ------------------------------------------
+all: checkconf version.h $(TARGET)
+
+$(PORT_LIBS): FORCE
+ $(MAKE) -C $(dir $@)
+
+FORCE:
+
+$(top_builddir)/support/gc/libgc.a:
+ $(MAKE) -C $(top_builddir)/support/gc
+
+# Compiling and installing everything and runing test
+# ---------------------------------------------------
+install: all installdirs
+ $(INSTALL) $(TARGET) $(DESTDIR)$(bindir)/`echo sdcc|sed '$(transform)'`$(EXEEXT)
+ $(STRIP) $(DESTDIR)$(bindir)/`echo sdcc|sed '$(transform)'`$(EXEEXT)
+
+
+# Deleting all the installed files
+# --------------------------------
+uninstall:
+ rm -f $(DESTDIR)$(bindir)/`echo sdcc|sed '$(transform)'`$(EXEEXT)
+
+# Performing self-test
+# --------------------
+check:
+
+
+# Performing installation test
+# ----------------------------
+installcheck:
+
+
+# Creating installation directories
+# ---------------------------------
+installdirs:
+ $(INSTALL) -d $(DESTDIR)$(bindir)
+
+
+# Creating dependencies
+# ---------------------
+dep: version.h Makefile.dep
+
+Makefile.dep: version.h $(SOURCES) $(CXXSOURCES) $(SLIBSOURCES) $(SPECIAL)
+ $(MAKEDEP) $(CPPFLAGS) $(filter %.c,$^) $(filter %.cc,$^) >Makefile.dep
+
+# don't include Makefile.dep for the listed targets:
+ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs checkconf \
+ clean distclean mostlyclean realclean)" ""
+ -include Makefile.dep
+endif
+include $(srcdir)/clean.mk
+
+
+# My rules
+# --------
+$(TARGET): $(SLIBOBJS) $(OBJECTS) $(PORT_LIBS)
+ $(CXX) $(LDFLAGS) -o $@ $(SLIBOBJS) $(OBJECTS) $(PORT_LIBS) $(LIBDIRS) $(LIBS)
+
+.c.o:
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+$(SLIBOBJS):%.o:$(SLIB)/%.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+reswords.h: reswords.gperf Makefile
+ gperf -o -k1,2,4 -t -C -N is_reserved_word $< > $@
+
+altlex.o: altlex.c SDCCy.h reswords.h
+
+SDCCy.h: SDCCy.c
+
+SDCCy.c: SDCC.y
+ $(YACC) -d $<
+ mv y.tab.c $*.c
+ mv y.tab.h $*.h
+
+SDCClex.c: SDCC.lex SDCCy.h
+ $(LEX) -8 -f -t $< >$@
+
+version.h: ../ChangeLog
+ $(AWK) -f $(srcdir)/version.awk $< > $@
+
+.l.c:
+ rm -f $*.cc
+ $(LEX) -t $< >$*.cc
+
+
+# Remaking configuration
+# ----------------------
+checkconf:
+ @if [ -f $(top_builddir)/devel ]; then\
+ $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" \
+ freshconf;\
+ fi
+
+# End of main_in.mk/main.mk
diff --git a/src/Makefile.in b/src/Makefile.in
index dff9d62..dc36cdd 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -36,7 +36,7 @@ OBJECTS = SDCCy.o SDCChasht.o SDCCmain.o \
SDCCasm.o SDCCmacro.o SDCCutil.o SDCCdebug.o cdbFile.o SDCCdwarf2.o\
SDCCerr.o SDCCsystem.o SDCCgen.o
-SPECIAL = SDCCy.h
+SPECIAL = SDCCy.h
ifeq ($(USE_ALT_LEX), 1)
OBJECTS += altlex.o
SPECIAL += reswords.h
@@ -57,7 +57,7 @@ TARGET = $(top_builddir)/bin/sdcc$(EXEEXT)
# ------------------------------------------
all: checkconf version.h $(TARGET)
-$(PORT_LIBS): FORCE
+$(PORT_LIBS): FORCE
$(MAKE) -C $(dir $@)
FORCE:
diff --git a/src/pdk/Makefile.dep b/src/pdk/Makefile.dep
deleted file mode 100644
index 8edde56..0000000
--- a/src/pdk/Makefile.dep
+++ /dev/null
@@ -1,45 +0,0 @@
-gen.o: gen.c ralloc.h ../common.h ../SDCCglobl.h ../SDCCset.h \
- ../../sdccconf.h ../SDCCerr.h ../SDCCmem.h ../../support/util/dbuf.h \
- ../SDCCast.h ../SDCCsymt.h ../SDCChasht.h ../SDCCval.h ../SDCCy.h \
- ../SDCCbitv.h ../SDCCicode.h ../SDCClabel.h ../SDCCBBlock.h \
- ../SDCCloop.h ../SDCCcse.h ../SDCCcflow.h ../SDCCdflow.h ../SDCClrange.h \
- ../SDCCptropt.h ../SDCCopt.h ../SDCCglue.h ../SDCCpeeph.h ../SDCCgen.h \
- ../SDCCicode.h ../SDCCdebug.h ../SDCCutil.h ../SDCCasm.h ../SDCCsystem.h \
- ../port.h ../SDCCargs.h ../../support/util/newalloc.h gen.h
-main.o: main.c ../common.h ../SDCCglobl.h ../SDCCset.h ../../sdccconf.h \
- ../SDCCerr.h ../SDCCmem.h ../../support/util/dbuf.h ../SDCCast.h \
- ../SDCCsymt.h ../SDCChasht.h ../SDCCval.h ../SDCCy.h ../SDCCbitv.h \
- ../SDCCicode.h ../SDCClabel.h ../SDCCBBlock.h ../SDCCloop.h ../SDCCcse.h \
- ../SDCCcflow.h ../SDCCdflow.h ../SDCClrange.h ../SDCCptropt.h \
- ../SDCCopt.h ../SDCCglue.h ../SDCCpeeph.h ../SDCCgen.h ../SDCCicode.h \
- ../SDCCdebug.h ../SDCCutil.h ../SDCCasm.h ../SDCCsystem.h ../port.h \
- ../SDCCargs.h ../../support/util/newalloc.h \
- ../../support/util/dbuf_string.h ../../support/util/dbuf.h ralloc.h \
- peep.h peeph.rul
-peep.o: peep.c ../common.h ../SDCCglobl.h ../SDCCset.h ../../sdccconf.h \
- ../SDCCerr.h ../SDCCmem.h ../../support/util/dbuf.h ../SDCCast.h \
- ../SDCCsymt.h ../SDCChasht.h ../SDCCval.h ../SDCCy.h ../SDCCbitv.h \
- ../SDCCicode.h ../SDCClabel.h ../SDCCBBlock.h ../SDCCloop.h ../SDCCcse.h \
- ../SDCCcflow.h ../SDCCdflow.h ../SDCClrange.h ../SDCCptropt.h \
- ../SDCCopt.h ../SDCCglue.h ../SDCCpeeph.h ../SDCCgen.h ../SDCCicode.h \
- ../SDCCdebug.h ../SDCCutil.h ../SDCCasm.h ../SDCCsystem.h ../port.h \
- ../SDCCargs.h ../../support/util/newalloc.h ../SDCCgen.h peep.h
-ralloc.o: ralloc.c ralloc.h ../common.h ../SDCCglobl.h ../SDCCset.h \
- ../../sdccconf.h ../SDCCerr.h ../SDCCmem.h ../../support/util/dbuf.h \
- ../SDCCast.h ../SDCCsymt.h ../SDCChasht.h ../SDCCval.h ../SDCCy.h \
- ../SDCCbitv.h ../SDCCicode.h ../SDCClabel.h ../SDCCBBlock.h \
- ../SDCCloop.h ../SDCCcse.h ../SDCCcflow.h ../SDCCdflow.h ../SDCClrange.h \
- ../SDCCptropt.h ../SDCCopt.h ../SDCCglue.h ../SDCCpeeph.h ../SDCCgen.h \
- ../SDCCicode.h ../SDCCdebug.h ../SDCCutil.h ../SDCCasm.h ../SDCCsystem.h \
- ../port.h ../SDCCargs.h ../../support/util/newalloc.h gen.h \
- ../../support/util/dbuf_string.h ../../support/util/dbuf.h
-ralloc2.o: ralloc2.cc ../SDCCralloc.hpp ../common.h ../SDCCglobl.h \
- ../SDCCset.h ../../sdccconf.h ../SDCCerr.h ../SDCCmem.h \
- ../../support/util/dbuf.h ../SDCCast.h ../SDCCsymt.h ../SDCChasht.h \
- ../SDCCval.h ../SDCCy.h ../SDCCbitv.h ../SDCCicode.h ../SDCClabel.h \
- ../SDCCBBlock.h ../SDCCloop.h ../SDCCcse.h ../SDCCcflow.h ../SDCCdflow.h \
- ../SDCClrange.h ../SDCCptropt.h ../SDCCopt.h ../SDCCglue.h \
- ../SDCCpeeph.h ../SDCCgen.h ../SDCCicode.h ../SDCCdebug.h ../SDCCutil.h \
- ../SDCCasm.h ../SDCCsystem.h ../port.h ../SDCCargs.h \
- ../../support/util/newalloc.h ../SDCCbtree.h ../SDCCtree_dec.hpp \
- ../SDCCsalloc.hpp ralloc.h ../common.h gen.h
diff --git a/src/pdk/gen.o b/src/pdk/gen.o
deleted file mode 100644
index f9cc656..0000000
--- a/src/pdk/gen.o
+++ /dev/null
Binary files differ
diff --git a/src/pdk/main.o b/src/pdk/main.o
deleted file mode 100644
index 79372bb..0000000
--- a/src/pdk/main.o
+++ /dev/null
Binary files differ
diff --git a/src/pdk/peep.o b/src/pdk/peep.o
deleted file mode 100644
index 50fc2b6..0000000
--- a/src/pdk/peep.o
+++ /dev/null
Binary files differ
diff --git a/src/pdk/peeph.rul b/src/pdk/peeph.rul
deleted file mode 100644
index fbaeb82..0000000
--- a/src/pdk/peeph.rul
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Generated file, DO NOT Edit! */
-/* To Make changes to rules edit */
-/* <port>/peeph.def instead. */
-"\n"
-"replace restart {\n"
-" mov %1, %2\n"
-"} by {\n"
-" ; peephole 0 removed dead load into %1 from %2.\n"
-"} if notUsed(%1)\n"
-"\n"
-"replace restart {\n"
-" mov %1, a\n"
-" mov a, %1\n"
-"} by {\n"
-" mov %1, a\n"
-" ; peephole 1 removed redundant load from %1 into a.\n"
-"} if notVolatile(%1)\n"
-"\n"
-"\n"
-"replace restart {\n"
-" mov a, #%1\n"
-" ret\n"
-"} by {\n"
-" ; peephole 2 moved load to ret.\n"
-" ret #%1\n"
-"}\n"
-"\n"
-"replace restart {\n"
-" xch a, %1\n"
-" xch a, %1\n"
-"} by {\n"
-" ; peephole 3 removed redundant double exchange between a and %1.\n"
-"} if notVolatile(%1)\n"
-"\n"
-"replace restart {\n"
-" mov a, #0x00\n"
-" slc a\n"
-" and a, #0x01\n"
-"} by {\n"
-" mov a, #0x00\n"
-" slc a\n"
-" ; peephole 4 removed redundant and.\n"
-"}\n"
-"\n"
-"replace restart {\n"
-"%1:\n"
-"} by {\n"
-" ; peephole j0 removed unused label %1.\n"
-"} if labelRefCount(%1 0)\n"
-"\n"
-"replace restart {\n"
-" ret %1\n"
-" ret\n"
-"} by {\n"
-" ret %1\n"
-" ; peephole j1 removed redundant ret after ret k.\n"
-"}\n"
-"\n"
diff --git a/src/pdk/ralloc.o b/src/pdk/ralloc.o
deleted file mode 100644
index c71d394..0000000
--- a/src/pdk/ralloc.o
+++ /dev/null
Binary files differ
diff --git a/src/pdk/ralloc2.o b/src/pdk/ralloc2.o
deleted file mode 100644
index 718d12c..0000000
--- a/src/pdk/ralloc2.o
+++ /dev/null
Binary files differ
diff --git a/src/regression/Makefile b/src/regression/Makefile
new file mode 100644
index 0000000..26a7ff3
--- /dev/null
+++ b/src/regression/Makefile
@@ -0,0 +1,226 @@
+# Regression testing Makefile for Pic Port of SDCC
+#
+# note that this regression suite was started before
+# the one in sdcc/regression. The regression suite in
+# sdcc/regression is better suited for testing mature
+# ports.
+#
+# GPL'd
+#
+# T. Scott Dattalo scott@dattalo.com
+#
+# This makefile provides a means by which the output
+# of the SDCC Compiler can be tested. This version
+# is unique to the PIC (as in Microchip PIC) port.
+# As such it requires the following software:
+#
+# gpasm version 0.11.1 (or greater)
+# gpsim version 0.20.7 (or greater)
+#
+# Usage:
+#
+# make
+# - without any options the whole regression test is
+# performed. The results are placed into a log file
+# (defined by $LOGFILE).
+#
+# make asm
+# - Creates .asm files by compiling the .c files
+#
+# make cod
+# - Creates .cod files by assembling the .asm files
+# (.cod files are symbolic files compatible with
+# MPASM, Microchip's assembler)
+#
+# make stc
+# - Creates .stc files which are script files for
+# gpsim.
+#
+# make clean
+# - removes all of the intermediate files created
+#
+# make cleancod
+# make cleanasm
+# make cleanstc
+# make cleano
+# - removes either the .stc, .asm, .cod or .o files
+
+# verboseness
+#Q ?= # be verbose
+Q ?= @ # be quiet
+
+SDCC_SRC=../..
+SDCC_BIN=../..
+
+CC = $(SDCC_BIN)/bin/sdcc
+LINKER = gplink
+USE_PIC16 ?= 0
+ifeq ($(strip $(filter 1 yes,$(USE_PIC16))),)
+TARGETPIC = 16f877
+#TARGETPIC = 16f84
+CFLAGS = -mpic14 -p$(TARGETPIC)
+DIR = pic14
+else
+TARGETPIC = 18f452
+CFLAGS = -mpic16 -p$(TARGETPIC)
+DIR = pic16
+endif
+CFLAGS += -Wl,-q --no-warn-non-free
+CFLAGS += -Wl,--map
+CFLAGS += -I $(SDCC_SRC)/device/include/$(DIR) -I $(SDCC_SRC)/device/non-free/include/$(DIR)
+CFLAGS += -L $(SDCC_BIN)/device/lib/build/$(DIR) -L $(SDCC_BIN)/device/non-free/lib/build/$(DIR)
+#CFLAGS += --no-pcode-opt
+#CFLAGS += -V
+
+.SUFFIXES: .asm .c .cod .stc
+.NOTPARALLEL:
+
+# Results of the test are placed here:
+LOGFILE = test.log
+
+# Script file for creating gpsim scripts
+CREATESTC = create_stc
+
+# Script file for invoking gpsim
+SIMULATE = simulate
+
+# List the C files to be test here:
+SRC = add.c \
+ add2.c \
+ add3.c \
+ add4.c \
+ and1.c \
+ and2.c \
+ arrays.c \
+ b.c \
+ bank1.c \
+ bool1.c \
+ bool2.c \
+ bool3.c \
+ call1.c \
+ compare.c \
+ compare10.c \
+ compare2.c \
+ compare3.c \
+ compare4.c \
+ compare5.c \
+ compare6.c \
+ compare7.c \
+ compare8.c \
+ compare9.c \
+ configword.c \
+ empty.c \
+ for.c \
+ init0.c \
+ inline.c \
+ mult1.c \
+ nestfor.c \
+ or1.c \
+ pcodeopt.c \
+ pointer1.c \
+ ptrarg.c \
+ ptrfunc.c \
+ rotate1.c \
+ rotate2.c \
+ rotate3.c \
+ rotate4.c \
+ rotate5.c \
+ rotate6.c \
+ rotate7.c \
+ string1.c \
+ struct1.c \
+ sub.c \
+ sub2.c \
+ switch1.c \
+ while.c \
+ xor.c
+
+COD := $(patsubst %.c, %.cod, $(SRC))
+ASM := $(patsubst %.c, %.asm, $(SRC))
+O := $(patsubst %.c, %.o, $(SRC))
+P := $(patsubst %.c, %.p, $(SRC))
+STC := $(patsubst %.c, %.stc, $(SRC))
+HEX := $(patsubst %.c, %.hex, $(SRC))
+LST := $(patsubst %.c, %.lst, $(SRC))
+MAP := $(patsubst %.c, %.map, $(SRC))
+
+all: test
+
+
+# The cod files are generated by sdcc
+.c.cod:
+ $(Q)-$(CC) $(CFLAGS) $*.c
+
+# The .stc files are script files for gpsim
+.cod.stc:
+ $(Q)-./$(CREATESTC) $*.cod $*.stc
+ $(Q)-./$(SIMULATE) $*.stc $(LOGFILE)
+
+# this will also make .stc files
+#%.stc : %.cod
+# ./create_stc $^ $@
+
+# now for the dependencies
+
+cod : $(COD)
+
+o : $(O)
+
+asm : $(ASM)
+
+stc : $(STC)
+ echo $(STC)
+
+test: $(STC)
+ $(Q)echo "Done - Results are in $(LOGFILE)"
+
+cleancod:
+ files="$(COD)" ; \
+ for f in $$files ; do \
+ if [ -f $$f ]; then rm $$f; fi \
+ done ; \
+
+cleano:
+ files="$(O)" ; \
+ for f in $$files ; do \
+ if [ -f $$f ]; then rm $$f; fi \
+ done ; \
+
+cleanp:
+ files="$(P)" ; \
+ for f in $$files ; do \
+ if [ -f $$f ]; then rm $$f; fi \
+ done ; \
+
+cleanasm:
+ files="$(ASM)" ; \
+ for f in $$files ; do \
+ if [ -f $$f ]; then rm $$f; fi \
+ done ; \
+
+cleanstc:
+ files="$(STC)" ; \
+ for f in $$files ; do \
+ if [ -f $$f ]; then rm $$f; fi \
+ done ; \
+
+cleanhex:
+ files="$(HEX)" ; \
+ for f in $$files ; do \
+ if [ -f $$f ]; then rm $$f; fi \
+ done ; \
+
+cleanlst:
+ files="$(LST)" ; \
+ for f in $$files ; do \
+ if [ -f $$f ]; then rm $$f; fi \
+ done ; \
+
+cleanmap:
+ files="$(MAP)" ; \
+ for f in $$files ; do \
+ if [ -f $$f ]; then rm $$f; fi \
+ done ; \
+
+clean: cleancod cleanasm cleanstc cleano cleanp cleanhex cleanlst cleanmap
+ if [ -f "$(LOGFILE)" ]; then rm $(LOGFILE); fi