diff --git a/4coder_custom.so b/4coder_custom.so new file mode 100755 index 00000000..af64ad2a Binary files /dev/null and b/4coder_custom.so differ diff --git a/Makefile b/Makefile index 80794482..6a9abd02 100755 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ debug: ../build/build package: FLAGS += -DPACKAGE package: ../build/build +site: FLAGS += -DSITE_BUILD +site: ../build/build + ../build/build: $(CPP_FILES) $(C_FILES) $(H_FILES) g++ $(WARNINGS) $(FLAGS) build.cpp -g -o $@ ../build/build diff --git a/build.cpp b/build.cpp index dee8d757..f8a54446 100644 --- a/build.cpp +++ b/build.cpp @@ -454,6 +454,7 @@ enum{ OPTIMIZATION = 0x100, KEEP_ASSERT = 0x200, SITE_INCLUDES = 0x400, + NORMAL_SELF_INCLUDES = 0x800, }; @@ -590,6 +591,9 @@ build_cl(uint32_t flags, char *code_path, char *code_file, char *out_path, char #define GCC_INCLUDES \ "-I../foreign" +#define GCC_NORMAL_SELF_INCLUDES \ +"-I../code" + #define GCC_SITE_INCLUDES \ "-I../../code" @@ -623,6 +627,10 @@ build_gcc(uint32_t flags, char *code_path, char *code_file, char *out_path, char #endif } + if (flags & NORMAL_SELF_INCLUDES){ + build_ap(line, GCC_NORMAL_SELF_INCLUDES); + } + if (flags & SITE_INCLUDES){ build_ap(line, GCC_SITE_INCLUDES); } @@ -839,7 +847,7 @@ static void metagen(char *cdir){ { BEGIN_TIME_SECTION(); - build(OPTS | DEBUG_INFO, cdir, "4ed_metagen.cpp", META_DIR, "metagen", 0); + build(OPTS | DEBUG_INFO | NORMAL_SELF_INCLUDES, cdir, "4ed_metagen.cpp", META_DIR, "metagen", 0); END_TIME_SECTION("build metagen"); } @@ -915,7 +923,16 @@ site_build(char *cdir, uint32_t flags){ #if defined(IS_WINDOWS) systemf("pushd %s\\site & ..\\..\\build\\site\\sitegen .. source_material ..\\..\\site", cdir); #else - systemf("pushd %s/site & ../../build/site/sitegen .. source_material ../../site", cdir); + char space[512]; + String str = make_fixed_width_string(space); + append_sc(&str, cdir); + append_sc(&str, "/"); + append_sc(&str, "site"); + terminate_with_null(&str); + + Temp_Dir temp = linux_pushd(str.str); + systemf("../../build/site/sitegen .. source_material ../../site"); + linux_popd(temp); #endif END_TIME_SECTION("run metagen"); diff --git a/site/out_context.cpp b/site/out_context.cpp index f3dc8d45..7d0831b5 100644 --- a/site/out_context.cpp +++ b/site/out_context.cpp @@ -31,7 +31,7 @@ begin_file_out(Out_Context *out_context, char *filename, String *out){ String name = make_fixed_width_string(str_space); if (out_context->out_directory.size > 0){ append_ss(&name, out_context->out_directory); - append_sc(&name, "\\"); + append_sc(&name, "/"); } append_sc(&name, filename); terminate_with_null(&name); diff --git a/site/sitegen.cpp b/site/sitegen.cpp index 2afc4729..48140018 100644 --- a/site/sitegen.cpp +++ b/site/sitegen.cpp @@ -293,7 +293,7 @@ generate_site(char *code_directory, char *src_directory, char *dst_directory){ end_file_out(context); } else{ - // TODO(allen): warning + fprintf(stderr, "Failed to open %s", API_DOC); } }