diff --git a/4ed_app_target.cpp b/4ed_app_target.cpp index 38f0a560..773d5b71 100644 --- a/4ed_app_target.cpp +++ b/4ed_app_target.cpp @@ -14,7 +14,7 @@ // TODO(allen): get away from string.h #include -#include "4coder_API/4coder_custom.h" +#include "api/4coder_custom.h" #include "4coder_base_types.h" #include "4coder_table.h" diff --git a/meta/4ed_build.cpp b/bin/4ed_build.cpp similarity index 97% rename from meta/4ed_build.cpp rename to bin/4ed_build.cpp index a28a6172..40f40790 100644 --- a/meta/4ed_build.cpp +++ b/bin/4ed_build.cpp @@ -11,12 +11,15 @@ //#define FM_PRINT_COMMANDS -#include "../4coder_base_types.h" +#include "4coder_base_types.h" +#include "api/4coder_version.h" + +#include "4coder_base_types.cpp" +#include "4coder_malloc_allocator.cpp" #define FTECH_FILE_MOVING_IMPLEMENTATION -#include "4ed_file_moving.h" +#include "4coder_file_moving.h" -#include "../4coder_API/4coder_version.h" // // OS and compiler index @@ -79,7 +82,7 @@ char *compiler_names[] = { #define FOREIGN "../4coder-non-source/foreign" #define FOREIGN_WIN "..\\4coder-non-source\\foreign" -char *includes[] = { FOREIGN, FOREIGN"/freetype2", 0, }; +char *includes[] = { "custom", FOREIGN "/freetype2", 0, }; // // Platform layer file tables @@ -116,7 +119,7 @@ enum{ }; char *custom_files[] = { - "../code/4coder_default_bindings.cpp", + "../code/custom/4coder_default_bindings.cpp", }; // @@ -180,11 +183,11 @@ get_defines_from_flags(Arena *arena, u32 flags){ #define CL_LIBS_X64 \ "user32.lib winmm.lib gdi32.lib opengl32.lib comdlg32.lib " \ -FOREIGN_WIN"\\x64\\freetype.lib" +FOREIGN_WIN "\\x64\\freetype.lib" #define CL_LIBS_X86 \ "user32.lib winmm.lib gdi32.lib opengl32.lib comdlg32.lib " \ -FOREIGN_WIN"\\x86\\freetype.lib" +FOREIGN_WIN "\\x86\\freetype.lib" #define CL_ICON "..\\4coder-non-source\\res\\icon.res" @@ -485,7 +488,7 @@ do_buildsuper(Arena *arena, char *cdir, char *file, u32 arch){ BEGIN_TIME_SECTION(); Temp_Dir temp = fm_pushdir(fm_str(arena, BUILD_DIR)); - char *build_script = fm_str(arena, "buildsuper_", arch_names[arch], BAT); + char *build_script = fm_str(arena, "custom/bin/buildsuper_", arch_names[arch], BAT); char *build_command = fm_str(arena, "\"", cdir, "/", build_script, "\" \"", file, "\""); if (This_OS == Platform_Windows){ diff --git a/bin/build.bat b/bin/build.bat new file mode 100644 index 00000000..72adce94 --- /dev/null +++ b/bin/build.bat @@ -0,0 +1,33 @@ +@echo off + +set location=%cd% +set me="%~dp0" +cd %me% +cd .. +set src_root=%cd% +cd ..\build +set build_root=%cd% +set bin_root=%src_root%\bin +set custom_root=%src_root%\custom +set custom_bin=%custom_root\bin +cd %location% + +set mode=%1 +if "%mode%" == "" (set mode="/DDEV_BUILD") + +set opts=/W4 /wd4310 /wd4100 /wd4201 /wd4505 /wd4996 /wd4127 /wd4510 /wd4512 /wd4610 /wd4390 /wd4189 /WX +set opts=%opts% /GR- /EHa- /nologo /FC /Zi +set opts=%opts% /I%src_root% /I%custom_root% +set opts=%opts% %mode% + +set FirstError=0 +pushd %build_root% +call cl %opts% kernel32.lib %bin_root%\4ed_build.cpp /Febuild +if %ERRORLEVEL% neq 0 (set FirstError=1) +if %ERRORLEVEL% neq 0 (goto END) +popd + +%build_root%\build +:END +if %ERRORLEVEL% neq 0 (set FirstError=1) + diff --git a/build.sh b/bin/build.sh old mode 100755 new mode 100644 similarity index 100% rename from build.sh rename to bin/build.sh diff --git a/build_optimized.bat b/bin/build_optimized.bat similarity index 100% rename from build_optimized.bat rename to bin/build_optimized.bat diff --git a/build_x86.sh b/bin/build_x86.sh similarity index 100% rename from build_x86.sh rename to bin/build_x86.sh diff --git a/itchio_push_all.bat b/bin/itchio_push_all.bat similarity index 100% rename from itchio_push_all.bat rename to bin/itchio_push_all.bat diff --git a/itchio_push_all.sh b/bin/itchio_push_all.sh old mode 100755 new mode 100644 similarity index 100% rename from itchio_push_all.sh rename to bin/itchio_push_all.sh diff --git a/package.bat b/bin/package.bat similarity index 100% rename from package.bat rename to bin/package.bat diff --git a/package.sh b/bin/package.sh old mode 100755 new mode 100644 similarity index 100% rename from package.sh rename to bin/package.sh diff --git a/zip.bat b/bin/zip.bat similarity index 100% rename from zip.bat rename to bin/zip.bat diff --git a/build.bat b/build.bat deleted file mode 100644 index 04f67d53..00000000 --- a/build.bat +++ /dev/null @@ -1,20 +0,0 @@ -@echo off - -set opts=/W4 /wd4310 /wd4100 /wd4201 /wd4505 /wd4996 /wd4127 /wd4510 /wd4512 /wd4610 /wd4390 /wd4189 /WX -set opts=%opts% /GR- /EHa- /nologo /FC - -set FirstError=0 - -set build_mode=%1 -if "%build_mode%" == "" (set build_mode="/DDEV_BUILD") - -pushd ..\build -call cl %opts% kernel32.lib ..\code\meta\4ed_build.cpp /Zi /Febuild %build_mode% -if %ERRORLEVEL% neq 0 (set FirstError=1) -if %ERRORLEVEL% neq 0 (goto END) -popd - -..\build\build -:END -if %ERRORLEVEL% neq 0 (set FirstError=1) - diff --git a/build_config_parser_generator.bat b/build_config_parser_generator.bat deleted file mode 100644 index 904667a7..00000000 --- a/build_config_parser_generator.bat +++ /dev/null @@ -1,10 +0,0 @@ -@echo off - -set opts=/W4 /wd4310 /wd4100 /wd4201 /wd4505 /wd4996 /wd4127 /wd4510 /wd4512 /wd4610 /wd4390 /WX -set opts=%opts% /GR- /EHa- /nologo /FC -set opts=%opts% /Zi - -pushd ..\build -cl %opts% ..\code\meta\4ed_meta_generate_parser.cpp /Fegenerate_config_parser -popd - diff --git a/buildsuper_x64.bat b/buildsuper_x64.bat deleted file mode 100644 index 89e9296e..00000000 --- a/buildsuper_x64.bat +++ /dev/null @@ -1,36 +0,0 @@ -@echo off - -set code_home=%~dp0 -if %code_home:~-1%==\ (set code_home=%code_home:~0,-1%) - -if NOT "%Platform%" == "X64" IF NOT "%Platform%" == "x64" (call "%code_home%\windows_scripts\setup_cl_x64.bat") - -set src=%1 -if "%src%" == "" set src=4coder_default_bindings.cpp - -set opts=/W4 /wd4310 /wd4100 /wd4201 /wd4505 /wd4996 /wd4127 /wd4510 /wd4512 /wd4610 /wd4457 /WX -set opts=%opts% /GR- /nologo /FC -set debug=/Zi -set release=/O2 /Zi -set build_dll=/LD /link /INCREMENTAL:NO /OPT:REF /RELEASE /PDBALTPATH:%%%%_PDB%%%% -set exports=/EXPORT:get_bindings /EXPORT:get_alpha_4coder_version - -set mode=%debug% -if "%2" == "release" (set mode=%release%) - -set preproc_file=4coder_command_metadata.i -set meta_macros=/DMETA_PASS -call cl /I"%code_home%" %opts% %mode% %src% /P /Fi%preproc_file% %meta_macros% -call cl /I"%code_home%" %opts% %mode% "%code_home%\4coder_metadata_generator.cpp" /Femetadata_generator -metadata_generator -R "%code_home%" "%cd%\%preproc_file%" - -call cl /I"%code_home%" %opts% %mode% %src% /Fecustom_4coder %build_dll% %exports% - -exit - -REM file spammation preventation -del metadata_generator* -del *.exp -del *.obj -del *.lib -del %preproc_file% diff --git a/4coder_app_links_allocator.cpp b/custom/4coder_app_links_allocator.cpp similarity index 100% rename from 4coder_app_links_allocator.cpp rename to custom/4coder_app_links_allocator.cpp diff --git a/4coder_auto_indent.cpp b/custom/4coder_auto_indent.cpp similarity index 100% rename from 4coder_auto_indent.cpp rename to custom/4coder_auto_indent.cpp diff --git a/4coder_auto_indent.h b/custom/4coder_auto_indent.h similarity index 100% rename from 4coder_auto_indent.h rename to custom/4coder_auto_indent.h diff --git a/4coder_base_commands.cpp b/custom/4coder_base_commands.cpp similarity index 100% rename from 4coder_base_commands.cpp rename to custom/4coder_base_commands.cpp diff --git a/4coder_base_types.cpp b/custom/4coder_base_types.cpp similarity index 100% rename from 4coder_base_types.cpp rename to custom/4coder_base_types.cpp diff --git a/4coder_base_types.h b/custom/4coder_base_types.h similarity index 100% rename from 4coder_base_types.h rename to custom/4coder_base_types.h diff --git a/4coder_buffer_seek_constructors.cpp b/custom/4coder_buffer_seek_constructors.cpp similarity index 100% rename from 4coder_buffer_seek_constructors.cpp rename to custom/4coder_buffer_seek_constructors.cpp diff --git a/4coder_build_commands.cpp b/custom/4coder_build_commands.cpp similarity index 100% rename from 4coder_build_commands.cpp rename to custom/4coder_build_commands.cpp diff --git a/4coder_build_commands.h b/custom/4coder_build_commands.h similarity index 100% rename from 4coder_build_commands.h rename to custom/4coder_build_commands.h diff --git a/4coder_clipboard.cpp b/custom/4coder_clipboard.cpp similarity index 100% rename from 4coder_clipboard.cpp rename to custom/4coder_clipboard.cpp diff --git a/4coder_combined_write_commands.cpp b/custom/4coder_combined_write_commands.cpp similarity index 100% rename from 4coder_combined_write_commands.cpp rename to custom/4coder_combined_write_commands.cpp diff --git a/4coder_combined_write_commands.h b/custom/4coder_combined_write_commands.h similarity index 100% rename from 4coder_combined_write_commands.h rename to custom/4coder_combined_write_commands.h diff --git a/4coder_config.cpp b/custom/4coder_config.cpp similarity index 100% rename from 4coder_config.cpp rename to custom/4coder_config.cpp diff --git a/4coder_config.h b/custom/4coder_config.h similarity index 100% rename from 4coder_config.h rename to custom/4coder_config.h diff --git a/4coder_config_grammar.txt b/custom/4coder_config_grammar.txt similarity index 100% rename from 4coder_config_grammar.txt rename to custom/4coder_config_grammar.txt diff --git a/4coder_default_bindings.cpp b/custom/4coder_default_bindings.cpp similarity index 100% rename from 4coder_default_bindings.cpp rename to custom/4coder_default_bindings.cpp diff --git a/4coder_default_framework.cpp b/custom/4coder_default_framework.cpp similarity index 100% rename from 4coder_default_framework.cpp rename to custom/4coder_default_framework.cpp diff --git a/4coder_default_framework.h b/custom/4coder_default_framework.h similarity index 100% rename from 4coder_default_framework.h rename to custom/4coder_default_framework.h diff --git a/4coder_default_framework_variables.cpp b/custom/4coder_default_framework_variables.cpp similarity index 100% rename from 4coder_default_framework_variables.cpp rename to custom/4coder_default_framework_variables.cpp diff --git a/4coder_default_hooks.cpp b/custom/4coder_default_hooks.cpp similarity index 100% rename from 4coder_default_hooks.cpp rename to custom/4coder_default_hooks.cpp diff --git a/4coder_default_include.cpp b/custom/4coder_default_include.cpp similarity index 96% rename from 4coder_default_include.cpp rename to custom/4coder_default_include.cpp index 2a1c6ef8..24539d64 100644 --- a/4coder_default_include.cpp +++ b/custom/4coder_default_include.cpp @@ -7,9 +7,8 @@ #if !defined(FCODER_DEFAULT_INCLUDE_CPP) #define FCODER_DEFAULT_INCLUDE_CPP -#include "4coder_API/4coder_custom.h" - -#include "4coder_generated/command_metadata.h" +#include "api/4coder_custom.h" +#include "generated/command_metadata.h" #include "4coder_base_types.cpp" #include "4coder_stringf.cpp" diff --git a/4coder_fancy.cpp b/custom/4coder_fancy.cpp similarity index 100% rename from 4coder_fancy.cpp rename to custom/4coder_fancy.cpp diff --git a/4coder_fancy.h b/custom/4coder_fancy.h similarity index 100% rename from 4coder_fancy.h rename to custom/4coder_fancy.h diff --git a/4coder_file.h b/custom/4coder_file.h similarity index 100% rename from 4coder_file.h rename to custom/4coder_file.h diff --git a/meta/4ed_file_moving.h b/custom/4coder_file_moving.h similarity index 99% rename from meta/4ed_file_moving.h rename to custom/4coder_file_moving.h index 5716f4a2..4a6d17fd 100644 --- a/meta/4ed_file_moving.h +++ b/custom/4coder_file_moving.h @@ -12,16 +12,11 @@ #if !defined(FRED_FILE_MOVING_H) #define FRED_FILE_MOVING_H -#include "../4coder_base_types.h" - #include // include system for windows #include // include system for linux (YAY!) #include #include -#include "../4coder_base_types.cpp" -#include "../4coder_malloc_allocator.cpp" - // // API // diff --git a/4coder_font_helper.cpp b/custom/4coder_font_helper.cpp similarity index 100% rename from 4coder_font_helper.cpp rename to custom/4coder_font_helper.cpp diff --git a/4coder_function_list.cpp b/custom/4coder_function_list.cpp similarity index 100% rename from 4coder_function_list.cpp rename to custom/4coder_function_list.cpp diff --git a/4coder_function_list.h b/custom/4coder_function_list.h similarity index 100% rename from 4coder_function_list.h rename to custom/4coder_function_list.h diff --git a/4coder_hash_functions.cpp b/custom/4coder_hash_functions.cpp similarity index 100% rename from 4coder_hash_functions.cpp rename to custom/4coder_hash_functions.cpp diff --git a/4coder_helper.cpp b/custom/4coder_helper.cpp similarity index 100% rename from 4coder_helper.cpp rename to custom/4coder_helper.cpp diff --git a/4coder_helper.h b/custom/4coder_helper.h similarity index 100% rename from 4coder_helper.h rename to custom/4coder_helper.h diff --git a/4coder_insertion.cpp b/custom/4coder_insertion.cpp similarity index 100% rename from 4coder_insertion.cpp rename to custom/4coder_insertion.cpp diff --git a/4coder_insertion.h b/custom/4coder_insertion.h similarity index 100% rename from 4coder_insertion.h rename to custom/4coder_insertion.h diff --git a/4coder_jump_lister.cpp b/custom/4coder_jump_lister.cpp similarity index 100% rename from 4coder_jump_lister.cpp rename to custom/4coder_jump_lister.cpp diff --git a/4coder_jump_lister.h b/custom/4coder_jump_lister.h similarity index 100% rename from 4coder_jump_lister.h rename to custom/4coder_jump_lister.h diff --git a/4coder_jump_sticky.cpp b/custom/4coder_jump_sticky.cpp similarity index 100% rename from 4coder_jump_sticky.cpp rename to custom/4coder_jump_sticky.cpp diff --git a/4coder_jump_sticky.h b/custom/4coder_jump_sticky.h similarity index 100% rename from 4coder_jump_sticky.h rename to custom/4coder_jump_sticky.h diff --git a/4coder_jumping.cpp b/custom/4coder_jumping.cpp similarity index 100% rename from 4coder_jumping.cpp rename to custom/4coder_jumping.cpp diff --git a/4coder_jumping.h b/custom/4coder_jumping.h similarity index 100% rename from 4coder_jumping.h rename to custom/4coder_jumping.h diff --git a/4coder_lex_gen_cpp.cpp b/custom/4coder_lex_gen_cpp.cpp similarity index 100% rename from 4coder_lex_gen_cpp.cpp rename to custom/4coder_lex_gen_cpp.cpp diff --git a/4coder_lists.cpp b/custom/4coder_lists.cpp similarity index 100% rename from 4coder_lists.cpp rename to custom/4coder_lists.cpp diff --git a/4coder_log.cpp b/custom/4coder_log.cpp similarity index 100% rename from 4coder_log.cpp rename to custom/4coder_log.cpp diff --git a/4coder_log_parser.cpp b/custom/4coder_log_parser.cpp similarity index 100% rename from 4coder_log_parser.cpp rename to custom/4coder_log_parser.cpp diff --git a/4coder_log_parser.h b/custom/4coder_log_parser.h similarity index 100% rename from 4coder_log_parser.h rename to custom/4coder_log_parser.h diff --git a/4coder_malloc_allocator.cpp b/custom/4coder_malloc_allocator.cpp similarity index 100% rename from 4coder_malloc_allocator.cpp rename to custom/4coder_malloc_allocator.cpp diff --git a/4coder_metadata_generator.cpp b/custom/4coder_metadata_generator.cpp similarity index 99% rename from 4coder_metadata_generator.cpp rename to custom/4coder_metadata_generator.cpp index 209cd598..21308bf8 100644 --- a/4coder_metadata_generator.cpp +++ b/custom/4coder_metadata_generator.cpp @@ -4,7 +4,7 @@ // TOP -#define COMMAND_METADATA_OUT "4coder_generated/command_metadata.h" +#define COMMAND_METADATA_OUT "generated/command_metadata.h" #include "4coder_base_types.h" #include "4coder_token.h" diff --git a/4coder_miblo_numbers.cpp b/custom/4coder_miblo_numbers.cpp similarity index 100% rename from 4coder_miblo_numbers.cpp rename to custom/4coder_miblo_numbers.cpp diff --git a/4coder_project_commands.cpp b/custom/4coder_project_commands.cpp similarity index 100% rename from 4coder_project_commands.cpp rename to custom/4coder_project_commands.cpp diff --git a/4coder_project_commands.h b/custom/4coder_project_commands.h similarity index 100% rename from 4coder_project_commands.h rename to custom/4coder_project_commands.h diff --git a/4coder_remapping_commands.cpp b/custom/4coder_remapping_commands.cpp similarity index 97% rename from 4coder_remapping_commands.cpp rename to custom/4coder_remapping_commands.cpp index d80dc9d5..5e7e7f96 100644 --- a/4coder_remapping_commands.cpp +++ b/custom/4coder_remapping_commands.cpp @@ -12,7 +12,7 @@ in the set of default maps. // Buffer Filling Helpers // -#include "4coder_generated/remapping.h" +#include "generated/remapping.h" void default_keys(Bind_Helper *context){ diff --git a/4coder_scope_commands.cpp b/custom/4coder_scope_commands.cpp similarity index 100% rename from 4coder_scope_commands.cpp rename to custom/4coder_scope_commands.cpp diff --git a/4coder_scope_commands.h b/custom/4coder_scope_commands.h similarity index 100% rename from 4coder_scope_commands.h rename to custom/4coder_scope_commands.h diff --git a/4coder_search.cpp b/custom/4coder_search.cpp similarity index 100% rename from 4coder_search.cpp rename to custom/4coder_search.cpp diff --git a/4coder_search.h b/custom/4coder_search.h similarity index 100% rename from 4coder_search.h rename to custom/4coder_search.h diff --git a/4coder_string_match.cpp b/custom/4coder_string_match.cpp similarity index 100% rename from 4coder_string_match.cpp rename to custom/4coder_string_match.cpp diff --git a/4coder_string_match.h b/custom/4coder_string_match.h similarity index 100% rename from 4coder_string_match.h rename to custom/4coder_string_match.h diff --git a/4coder_stringf.cpp b/custom/4coder_stringf.cpp similarity index 100% rename from 4coder_stringf.cpp rename to custom/4coder_stringf.cpp diff --git a/4coder_system_command.cpp b/custom/4coder_system_command.cpp similarity index 100% rename from 4coder_system_command.cpp rename to custom/4coder_system_command.cpp diff --git a/4coder_table.cpp b/custom/4coder_table.cpp similarity index 100% rename from 4coder_table.cpp rename to custom/4coder_table.cpp diff --git a/4coder_table.h b/custom/4coder_table.h similarity index 100% rename from 4coder_table.h rename to custom/4coder_table.h diff --git a/4coder_token.cpp b/custom/4coder_token.cpp similarity index 100% rename from 4coder_token.cpp rename to custom/4coder_token.cpp diff --git a/4coder_token.h b/custom/4coder_token.h similarity index 100% rename from 4coder_token.h rename to custom/4coder_token.h diff --git a/4coder_ui_helper.cpp b/custom/4coder_ui_helper.cpp similarity index 100% rename from 4coder_ui_helper.cpp rename to custom/4coder_ui_helper.cpp diff --git a/4coder_ui_helper.h b/custom/4coder_ui_helper.h similarity index 100% rename from 4coder_ui_helper.h rename to custom/4coder_ui_helper.h diff --git a/4coder_API/4coder_custom.h b/custom/api/4coder_custom.h similarity index 54% rename from 4coder_API/4coder_custom.h rename to custom/api/4coder_custom.h index 96a98df5..4da4cf51 100644 --- a/4coder_API/4coder_custom.h +++ b/custom/api/4coder_custom.h @@ -8,11 +8,11 @@ #define FCODER_CUSTOM_H #include "4coder_base_types.h" -#include "4coder_API/4coder_version.h" -#include "4coder_API/4coder_keycodes.h" -#include "4coder_API/4coder_default_colors.h" -#include "4coder_API/4coder_types.h" -#include "4coder_generated/app_functions.h" +#include "api/4coder_version.h" +#include "api/4coder_keycodes.h" +#include "api/4coder_default_colors.h" +#include "api/4coder_types.h" +#include "generated/app_functions.h" extern "C" _GET_VERSION_SIG(get_alpha_4coder_version){ return((maj == MAJOR && min == MINOR && patch == PATCH)); diff --git a/4coder_API/4coder_default_colors.h b/custom/api/4coder_default_colors.h similarity index 100% rename from 4coder_API/4coder_default_colors.h rename to custom/api/4coder_default_colors.h diff --git a/4coder_API/4coder_keycodes.h b/custom/api/4coder_keycodes.h similarity index 100% rename from 4coder_API/4coder_keycodes.h rename to custom/api/4coder_keycodes.h diff --git a/4coder_API/4coder_types.h b/custom/api/4coder_types.h similarity index 100% rename from 4coder_API/4coder_types.h rename to custom/api/4coder_types.h diff --git a/4coder_API/4coder_version.h b/custom/api/4coder_version.h similarity index 100% rename from 4coder_API/4coder_version.h rename to custom/api/4coder_version.h diff --git a/build_metadata.bat b/custom/bin/build_metadata.bat similarity index 100% rename from build_metadata.bat rename to custom/bin/build_metadata.bat diff --git a/build_metadata.sh b/custom/bin/build_metadata.sh old mode 100755 new mode 100644 similarity index 100% rename from build_metadata.sh rename to custom/bin/build_metadata.sh diff --git a/build_generator.bat b/custom/bin/build_one_time.bat similarity index 100% rename from build_generator.bat rename to custom/bin/build_one_time.bat diff --git a/custom/bin/buildsuper_x64.bat b/custom/bin/buildsuper_x64.bat new file mode 100644 index 00000000..554b9958 --- /dev/null +++ b/custom/bin/buildsuper_x64.bat @@ -0,0 +1,56 @@ +@echo off + +REM usage: