scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit e0b2f47525a1dc50a5089d2f472f1b51fbb0b483
parent 87f8ea372e925ddb1ab531130bfd3e989e73c5b5
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 25 Apr 2014 10:33:28 +0200

Create directory cc1

We are going to begin with the backend of the compiler
so it is a good idea to have two different directories.

Diffstat:
DMakefile | 21---------------------
R.gitignore -> cc1/.gitignore | 0
Acc1/Makefile | 22++++++++++++++++++++++
Rcc1.h -> cc1/cc1.h | 0
Rcode.c -> cc1/code.c | 0
Rdecl.c -> cc1/decl.c | 0
Rerror.c -> cc1/error.c | 0
Rexpr.c -> cc1/expr.c | 0
Rlex.c -> cc1/lex.c | 0
Acc1/main.c | 25+++++++++++++++++++++++++
Ropcode.txt -> cc1/opcode.txt | 0
Rsizes.h -> cc1/sizes.h | 0
Rstmt.c -> cc1/stmt.c | 0
Rsymbol.c -> cc1/symbol.c | 0
Rtypes.c -> cc1/types.c | 0
Rwrapper.c -> cc1/wrapper.c | 0
Dmain.c | 25-------------------------
17 files changed, 47 insertions(+), 46 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,21 +0,0 @@ - -OBJS = types.o decl.o lex.o error.o symbol.o main.o expr.o \ - wrapper.o code.o stmt.o - - -all: cc1 - -$(OBJS) : cc1.h - -cc1: $(OBJS) - $(CC) $(LDFLAGS) $(CFLAGS) $(LIBS) $(OBJS) -o $@ - -clean: - rm -f $(OBJS) - rm -f cc1 - -distclean: clean - rm -f *~ - rm -f tags - rm -f cscope.* - rm -f makefile diff --git a/.gitignore b/cc1/.gitignore diff --git a/cc1/Makefile b/cc1/Makefile @@ -0,0 +1,22 @@ + +OBJS = types.o decl.o lex.o error.o symbol.o main.o expr.o \ + wrapper.o code.o stmt.o + +CFLAGS += -fno-diagnostics-show-caret -g + +all: cc1 + +$(OBJS) : cc1.h + +cc1: $(OBJS) + $(CC) $(LDFLAGS) $(CFLAGS) $(LIBS) $(OBJS) -o $@ + +clean: + rm -f $(OBJS) + rm -f cc1 + +distclean: clean + rm -f *~ + rm -f tags + rm -f cscope.* + rm -f makefile diff --git a/cc1.h b/cc1/cc1.h diff --git a/code.c b/cc1/code.c diff --git a/decl.c b/cc1/decl.c diff --git a/error.c b/cc1/error.c diff --git a/expr.c b/cc1/expr.c diff --git a/lex.c b/cc1/lex.c diff --git a/cc1/main.c b/cc1/main.c @@ -0,0 +1,25 @@ + +#include <stddef.h> +#include <stdint.h> +#include <stdio.h> + +#include "cc1.h" + +extern void init_keywords(void), + open_file(const char *file), init_expr(void); + +struct user_opt options; + +int +main(int argc, char *argv[]) +{ + //setvbuf(stdin, NULL, _IONBF, 0); + //setvbuf(stdout, NULL, _IONBF, 0); + init_keywords(); + init_expr(); + open_file(NULL); + for (next(); yytoken != EOFTOK; extdecl()); + /* nothing */; + + return 0; +} diff --git a/opcode.txt b/cc1/opcode.txt diff --git a/sizes.h b/cc1/sizes.h diff --git a/stmt.c b/cc1/stmt.c diff --git a/symbol.c b/cc1/symbol.c diff --git a/types.c b/cc1/types.c diff --git a/wrapper.c b/cc1/wrapper.c diff --git a/main.c b/main.c @@ -1,25 +0,0 @@ - -#include <stddef.h> -#include <stdint.h> -#include <stdio.h> - -#include "cc1.h" - -extern void init_keywords(void), - open_file(const char *file), init_expr(void); - -struct user_opt options; - -int -main(int argc, char *argv[]) -{ - setvbuf(stdin, NULL, _IONBF, 0); - setvbuf(stdout, NULL, _IONBF, 0); - init_keywords(); - init_expr(); - open_file(NULL); - for (next(); yytoken != EOFTOK; extdecl()); - /* nothing */; - - return 0; -}