diff --git a/.gitignore b/.gitignore index cecd060f..ac701d36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.o generated run +TAGS +bin/* \ No newline at end of file diff --git a/Makefile b/Makefile index fe0a273d..b4aa753d 100644 --- a/Makefile +++ b/Makefile @@ -18,16 +18,23 @@ ENDIAN=little # BIN=bin +# Lib dir +ifeq ($(OS),osx) +LIBDIR=/sw/lib +else +LIBDIR=/usr/lib +endif + RM=rm -f CC=gcc -CLD=gcc -O3 -L/sw/lib +CLD=gcc -O3 -L$(LIBDIR) YACC=bison -v -b$(GENERATED)/y LEX=lex INCLUDE=include GENERATED=generated DEFINES=-DU2_OS_$(OS) -DU2_OS_ENDIAN_$(ENDIAN) -CFLAGS=-O3 -I/sw/include -I$(INCLUDE) -I $(GENERATED) $(DEFINES) +CFLAGS=-O3 -I$(LIBDIR) -I$(INCLUDE) -I $(GENERATED) $(DEFINES) CWFLAGS=-Wall .y.o: diff --git a/c/vere.c b/c/vere.c index e9a562fa..75e10a41 100644 --- a/c/vere.c +++ b/c/vere.c @@ -439,9 +439,14 @@ _vere_kernel(struct vere_state* v, } else { if ( (stat(paq_c, &paq_stat) < 0) || +#ifdef U2_OS_linux + (pod_stat.st_mtime > paq_stat.st_mtime) +#else (pod_stat.st_mtimespec.tv_sec > paq_stat.st_mtimespec.tv_sec) || ((pod_stat.st_mtimespec.tv_sec == (pod_stat.st_mtimespec.tv_sec)) && - (pod_stat.st_mtimespec.tv_nsec > paq_stat.st_mtimespec.tv_nsec)) ) + (pod_stat.st_mtimespec.tv_nsec > paq_stat.st_mtimespec.tv_nsec)) +#end + ) { FILE *fil; u3_fox src, gen, ker; @@ -661,9 +666,14 @@ _vere_shell(struct vere_state* v, if ( v->new_b || (stat(paq_c, &paq_stat) < 0) || +#ifdef U2_OS_linux + (pod_stat.st_mtime > paq_stat.st_mtime) +#else (pod_stat.st_mtimespec.tv_sec > paq_stat.st_mtimespec.tv_sec) || ((pod_stat.st_mtimespec.tv_sec == (pod_stat.st_mtimespec.tv_sec)) && - (pod_stat.st_mtimespec.tv_nsec > paq_stat.st_mtimespec.tv_nsec)) ) + (pod_stat.st_mtimespec.tv_nsec > paq_stat.st_mtimespec.tv_nsec)) +#end + ) { printf("[vere: building shell: %s]\n", pod_c); ver = _vere_fire(v, _vere_file(v->x, pod_c)); diff --git a/f/unix.c b/f/unix.c index f12f0df0..c49d5bc2 100644 --- a/f/unix.c +++ b/f/unix.c @@ -306,9 +306,14 @@ u2_ux_fresh(const c3_c* paf_c, } else { if ( (stat(nom_c, &nom_stat) < 0) || +#ifdef U2_OS_linux + (nam_stat.st_mtime > nom_stat.st_mtime) +#else (nam_stat.st_mtimespec.tv_sec > nom_stat.st_mtimespec.tv_sec) || ((nam_stat.st_mtimespec.tv_sec == (nam_stat.st_mtimespec.tv_sec)) && - (nam_stat.st_mtimespec.tv_nsec > nom_stat.st_mtimespec.tv_nsec)) ) + (nam_stat.st_mtimespec.tv_nsec > nom_stat.st_mtimespec.tv_nsec)) +#endif + ) { return u2_no; } diff --git a/include/c/portable.h b/include/c/portable.h index a9dd83eb..20c6c8fc 100644 --- a/include/c/portable.h +++ b/include/c/portable.h @@ -53,7 +53,7 @@ **/ # if defined(U2_OS_linux) # define U2_OS_LoomBase 0x4000000 - +# define U2_OS_LoomBits 28 // ie, 2^28 words == 1GB # elif defined(U2_OS_osx) # ifdef __LP64__ # define U2_OS_LoomBase 0x200000000