scc

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

commit a9ea247aa42e042523dec840ff85a7e5c6cf9db7
parent 22892a0e1aea9d85bbffc82fbf99739ae7051024
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 18 Sep 2019 06:36:28 +0200

[as] Add powerpc64 skeleton

Diffstat:
Msrc/cmd/as/Makefile | 13++++++++-----
Msrc/cmd/as/deps.mk | 6++++++
Msrc/cmd/as/target/powerpc.mk | 12+++++++-----
Asrc/cmd/as/target/powerpc/.gitignore | 2++
Asrc/cmd/as/target/powerpc/powerpc64.c | 15+++++++++++++++
Asrc/cmd/as/target/powerpc64.mk | 12++++++++++++
6 files changed, 50 insertions(+), 10 deletions(-)

diff --git a/src/cmd/as/Makefile b/src/cmd/as/Makefile @@ -5,13 +5,15 @@ include $(PROJECTDIR)/scripts/rules.mk MORECFLAGS = -I$(INCDIR)/$(STD) -OBJS = main.o \ - symbol.o \ - ins.o \ - parser.o \ - expr.o \ +OBJS = \ + main.o\ + symbol.o\ + ins.o\ + parser.o\ + expr.o\ TARGET =\ + $(LIBEXEC)/as-powerpc64\ $(LIBEXEC)/as-powerpc\ $(LIBEXEC)/as-amd64\ $(LIBEXEC)/as-i386\ @@ -27,6 +29,7 @@ dep: inc-dep clean: rm -f target/*/*.o target/*/*tbl.c +include target/powerpc64.mk include target/powerpc.mk include target/amd64.mk include target/i386.mk diff --git a/src/cmd/as/deps.mk b/src/cmd/as/deps.mk @@ -16,6 +16,12 @@ ./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/powerpc64.o: $(INCDIR)/scc/scc/scc.h +./target/powerpc/powerpc64.o: ./target/powerpc/../../as.h +./target/powerpc/powerpc64.o: ./target/powerpc/proc.h +./target/powerpc/powerpc64tbl.o: $(INCDIR)/scc/scc/scc.h +./target/powerpc/powerpc64tbl.o: ./target/powerpc/../../as.h +./target/powerpc/powerpc64tbl.o: ./target/powerpc/../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 diff --git a/src/cmd/as/target/powerpc.mk b/src/cmd/as/target/powerpc.mk @@ -1,9 +1,11 @@ -POWERPC_OBJ = $(OBJS) \ - target/powerpc/powerpctbl.o \ - target/powerpc/powerpc.o \ - target/powerpc/ins.o \ +POWERPC = target/powerpc +POWERPC_OBJ =\ + $(OBJS)\ + $(POWERPC)/powerpctbl.o\ + $(POWERPC)/powerpc.o\ + $(POWERPC)/ins.o\ -target/powerpc/powerpctbl.c: target/powerpc/powerpc.dat target/powerpc/rules.dat +$(POWERPC)/powerpctbl.c: $(POWERPC)/powerpc.dat $(POWERPC)/rules.dat ./mktbl -f powerpc -c powerpc $(LIBEXEC)/as-powerpc: $(POWERPC_OBJ) diff --git a/src/cmd/as/target/powerpc/.gitignore b/src/cmd/as/target/powerpc/.gitignore @@ -0,0 +1,2 @@ +powerpc64tbl.c +powerpctbl.c diff --git a/src/cmd/as/target/powerpc/powerpc64.c b/src/cmd/as/target/powerpc/powerpc64.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/powerpc64.mk b/src/cmd/as/target/powerpc64.mk @@ -0,0 +1,12 @@ +POWERPC = target/powerpc +POWERPC64_OBJ =\ + $(OBJS)\ + $(POWERPC)/powerpc64tbl.o\ + $(POWERPC)/powerpc64.o\ + $(POWERPC)/ins.o\ + +$(POWERPC)/powerpc64tbl.c: $(POWERPC)/powerpc.dat $(POWERPC)/rules.dat + ./mktbl -f powerpc -c powerpc64 + +$(LIBEXEC)/as-powerpc64: $(POWERPC64_OBJ) + $(CC) $(SCC_LDFLAGS) $(POWERPC64_OBJ) -lscc -o $@