scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 764002620c1a71cbeb96adb491aaf024888bc0c9
parent a1184978d322ef887ac233416df8fcbbbaa3cd8e
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 18 Sep 2019 06:35:54 +0200

[ld] Add basic skeleton for powerpc

This skeleton helps to build poerpc but it acutally does
nothing.

Diffstat:
Msrc/cmd/as/Makefile | 11+++++++----
Msrc/cmd/as/deps.mk | 8++++++++
Asrc/cmd/as/target/powerpc.mk | 10++++++++++
Asrc/cmd/as/target/powerpc/ins.c | 14++++++++++++++
Asrc/cmd/as/target/powerpc/powerpc.c | 15+++++++++++++++
Asrc/cmd/as/target/powerpc/powerpc.dat | 0
Asrc/cmd/as/target/powerpc/proc.h | 0
Asrc/cmd/as/target/powerpc/rules.dat | 0
8 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/src/cmd/as/Makefile b/src/cmd/as/Makefile @@ -11,10 +11,12 @@ OBJS = main.o \ parser.o \ expr.o \ -TARGET = $(LIBEXEC)/as-amd64 \ - $(LIBEXEC)/as-i386 \ - $(LIBEXEC)/as-i286 \ - $(LIBEXEC)/as-z80 \ +TARGET =\ + $(LIBEXEC)/as-powerpc\ + $(LIBEXEC)/as-amd64\ + $(LIBEXEC)/as-i386\ + $(LIBEXEC)/as-i286\ + $(LIBEXEC)/as-z80 \ all: $(TARGET) @@ -25,6 +27,7 @@ dep: inc-dep clean: rm -f target/*/*.o target/*/*tbl.c +include target/powerpc.mk include target/amd64.mk include target/i386.mk include target/i286.mk diff --git a/src/cmd/as/deps.mk b/src/cmd/as/deps.mk @@ -11,6 +11,14 @@ ./parser.o: ./as.h ./symbol.o: $(INCDIR)/scc/scc/scc.h ./symbol.o: ./as.h +./target/powerpc/ins.o: $(INCDIR)/scc/scc/scc.h +./target/powerpc/ins.o: ./target/powerpc/../../as.h +./target/powerpc/powerpc.o: $(INCDIR)/scc/scc/scc.h +./target/powerpc/powerpc.o: ./target/powerpc/../../as.h +./target/powerpc/powerpc.o: ./target/powerpc/proc.h +./target/powerpc/powerpctbl.o: $(INCDIR)/scc/scc/scc.h +./target/powerpc/powerpctbl.o: ./target/powerpc/../../as.h +./target/powerpc/powerpctbl.o: ./target/powerpc/../powerpc/proc.h ./target/x80/ins.o: $(INCDIR)/scc/scc/scc.h ./target/x80/ins.o: ./target/x80/../../as.h ./target/x80/ins.o: ./target/x80/proc.h diff --git a/src/cmd/as/target/powerpc.mk b/src/cmd/as/target/powerpc.mk @@ -0,0 +1,10 @@ +POWERPC_OBJ = $(OBJS) \ + target/powerpc/powerpctbl.o \ + target/powerpc/powerpc.o \ + target/powerpc/ins.o \ + +target/powerpc/powerpctbl.c: target/powerpc/powerpc.dat target/powerpc/rules.dat + ./mktbl -f powerpc -c powerpc + +$(LIBEXEC)/as-powerpc: $(POWERPC_OBJ) + $(CC) $(SCC_LDFLAGS) $(POWERPC_OBJ) -lscc -o $@ diff --git a/src/cmd/as/target/powerpc/ins.c b/src/cmd/as/target/powerpc/ins.c @@ -0,0 +1,14 @@ +#include <scc/scc.h> + +#include "../../as.h" + +int +match(Op *op, Node **args) +{ + return 0; +} + +Node * +moperand(void) +{ +} diff --git a/src/cmd/as/target/powerpc/powerpc.c b/src/cmd/as/target/powerpc/powerpc.c @@ -0,0 +1,15 @@ +#include <stdlib.h> + +#include <scc/scc.h> + +#include "../../as.h" + +TUINT maxaddr = 0xFFFF; +int endian = LITTLE_ENDIAN; +int left2right = 0; +#include "proc.h" + +void +iarch(void) +{ +} diff --git a/src/cmd/as/target/powerpc/powerpc.dat b/src/cmd/as/target/powerpc/powerpc.dat diff --git a/src/cmd/as/target/powerpc/proc.h b/src/cmd/as/target/powerpc/proc.h diff --git a/src/cmd/as/target/powerpc/rules.dat b/src/cmd/as/target/powerpc/rules.dat