From 8c7071a10ba089150c133c3b62e2491e2fd39935 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Sat, 24 Aug 2019 16:10:51 +0900 Subject: [PATCH] Add parse.c and codegen.c to frankenbuild --- self.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/self.sh b/self.sh index a4608e2..ac833cf 100755 --- a/self.sh +++ b/self.sh @@ -19,6 +19,15 @@ long fread(void *ptr, long size, long nmemb, FILE *stream); int feof(FILE *stream); static void assert() {} int strcmp(char *s1, char *s2); +int printf(char *fmt, ...); +int sprintf(char *buf, char *fmt, ...); +long strlen(char *p); +int strncmp(char *p, char *q); +void *memcpy(char *dst, char *src, long n); +char *strndup(char *p, long n); +int isspace(int c); +char *strstr(char *haystack, char *needle); +long strtol(char *nptr, char **endptr, int base); EOF grep -v '^#' chibi.h >> $TMP/$1 @@ -28,6 +37,7 @@ EOF sed -i 's/\btrue\b/1/g; s/\bfalse\b/0/g;' $TMP/$1 sed -i 's/\bNULL\b/0/g' $TMP/$1 sed -i 's/, \.\.\.//g' $TMP/$1 + sed -i 's/INT_MAX/2147483647/g' $TMP/$1 ./chibicc $TMP/$1 > $TMP/${1%.c}.s gcc -c -o $TMP/${1%.c}.o $TMP/${1%.c}.s @@ -40,5 +50,7 @@ done expand main.c expand type.c +expand parse.c +expand codegen.c gcc -static -o chibicc-gen2 $TMP/*.o -- GitLab