parent
38414d5cb9
commit
f7f9192b41
|
@ -76,9 +76,9 @@ internal char **fm_prepare_list_internal(char **l1, ...);
|
||||||
internal char **fm_list_one_item(char *item);
|
internal char **fm_list_one_item(char *item);
|
||||||
|
|
||||||
// File System Navigation
|
// File System Navigation
|
||||||
typedef umem String_Temp;
|
typedef umem Temp_Memory;
|
||||||
internal String_Temp fm_begin_temp();
|
internal Temp_Memory fm_begin_temp();
|
||||||
internal void fm_end_temp(String_Temp temp);
|
internal void fm_end_temp(Temp_Memory temp);
|
||||||
|
|
||||||
internal i32 fm_get_current_directory(char *buffer, i32 max);
|
internal i32 fm_get_current_directory(char *buffer, i32 max);
|
||||||
|
|
||||||
|
@ -186,13 +186,13 @@ fm__init_memory(){
|
||||||
fm_arena_memory = (char*)malloc(fm_arena_max);
|
fm_arena_memory = (char*)malloc(fm_arena_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal String_Temp
|
internal Temp_Memory
|
||||||
fm_begin_temp(){
|
fm_begin_temp(){
|
||||||
return(fm_arena_pos);
|
return(fm_arena_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
fm_end_temp(String_Temp temp){
|
fm_end_temp(Temp_Memory temp){
|
||||||
fm_arena_pos = temp;
|
fm_arena_pos = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -189,6 +189,7 @@ get_defines_from_flags(u32 flags){
|
||||||
"user32.lib winmm.lib gdi32.lib opengl32.lib " \
|
"user32.lib winmm.lib gdi32.lib opengl32.lib " \
|
||||||
"..\\foreign_x86\\freetype.lib"
|
"..\\foreign_x86\\freetype.lib"
|
||||||
|
|
||||||
|
|
||||||
#define CL_ICON "..\\res\\icon.res"
|
#define CL_ICON "..\\res\\icon.res"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -209,8 +210,8 @@ build(u32 flags, u32 arch, char *code_path, char **code_files, char *out_path, c
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (arch){
|
switch (arch){
|
||||||
case Arch_X64: fm_add_to_line(line, "-DFTECH_64_BIT"); break;
|
case Arch_X64: fm_add_to_line(line, "/DFTECH_64_BIT"); break;
|
||||||
case Arch_X86: fm_add_to_line(line, "-DFTECH_32_BIT"); break;
|
case Arch_X86: fm_add_to_line(line, "/DFTECH_32_BIT"); break;
|
||||||
default: InvalidCodePath;
|
default: InvalidCodePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,7 +219,7 @@ build(u32 flags, u32 arch, char *code_path, char **code_files, char *out_path, c
|
||||||
if (inc_folders != 0){
|
if (inc_folders != 0){
|
||||||
for (u32 i = 0; inc_folders[i] != 0; ++i){
|
for (u32 i = 0; inc_folders[i] != 0; ++i){
|
||||||
char *str = fm_str(code_path, "/", inc_folders[i]);
|
char *str = fm_str(code_path, "/", inc_folders[i]);
|
||||||
fm_add_to_line(line, "-I%s", str);
|
fm_add_to_line(line, "/I%s", str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,21 +236,21 @@ build(u32 flags, u32 arch, char *code_path, char **code_files, char *out_path, c
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & DEBUG_INFO){
|
if (flags & DEBUG_INFO){
|
||||||
fm_add_to_line(line, "-Zi");
|
fm_add_to_line(line, "/Zi");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & OPTIMIZATION){
|
if (flags & OPTIMIZATION){
|
||||||
fm_add_to_line(line, "-O2");
|
fm_add_to_line(line, "/O2");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & SHARED_CODE){
|
if (flags & SHARED_CODE){
|
||||||
fm_add_to_line(line, "-LD");
|
fm_add_to_line(line, "/LD");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defines != 0){
|
if (defines != 0){
|
||||||
for (u32 i = 0; defines[i] != 0; ++i){
|
for (u32 i = 0; defines[i] != 0; ++i){
|
||||||
char *define_flag = fm_str("-D", defines[i]);
|
char *define_flag = fm_str("/D", defines[i]);
|
||||||
fm_add_to_line(line, "%s", define_flag);
|
fm_add_to_line(line, define_flag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,29 +258,29 @@ build(u32 flags, u32 arch, char *code_path, char **code_files, char *out_path, c
|
||||||
fm_add_to_line(line, "\"%s\\%s\"", code_path, code_files[i]);
|
fm_add_to_line(line, "\"%s\\%s\"", code_path, code_files[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
fm_add_to_line(line, "-Fe%s", out_file);
|
fm_add_to_line(line, "/Fe%s", out_file);
|
||||||
|
|
||||||
fm_add_to_line(line, "-link -INCREMENTAL:NO");
|
fm_add_to_line(line, "/link /INCREMENTAL:NO");
|
||||||
switch (arch){
|
switch (arch){
|
||||||
case Arch_X64: fm_add_to_line(line, "-MACHINE:X64"); break;
|
case Arch_X64: fm_add_to_line(line, "/MACHINE:X64"); break;
|
||||||
case Arch_X86: fm_add_to_line(line, "-MACHINE:X86"); break;
|
case Arch_X86: fm_add_to_line(line, "/MACHINE:X86"); break;
|
||||||
default: InvalidCodePath;
|
default: InvalidCodePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & DEBUG_INFO){
|
if (flags & DEBUG_INFO){
|
||||||
fm_add_to_line(line, "-DEBUG");
|
fm_add_to_line(line, "/DEBUG");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & SHARED_CODE){
|
if (flags & SHARED_CODE){
|
||||||
Assert(exports != 0);
|
Assert(exports != 0);
|
||||||
fm_add_to_line(line, "/OPT:REF");
|
fm_add_to_line(line, "/OPT:REF");
|
||||||
for (u32 i = 0; exports[i] != 0; ++i){
|
for (u32 i = 0; exports[i] != 0; ++i){
|
||||||
char *str = fm_str("-EXPORT:", exports[i]);
|
char *str = fm_str("/EXPORT:", exports[i]);
|
||||||
fm_add_to_line(line, "%s", str);
|
fm_add_to_line(line, "%s", str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
fm_add_to_line(line, "-NODEFAULTLIB:library");
|
fm_add_to_line(line, "/NODEFAULTLIB:library");
|
||||||
}
|
}
|
||||||
|
|
||||||
fm_finish_build_line(&line);
|
fm_finish_build_line(&line);
|
||||||
|
@ -354,6 +355,8 @@ build(u32 flags, u32 arch, char *code_path, char **code_files, char *out_path, c
|
||||||
}
|
}
|
||||||
|
|
||||||
fm_add_to_line(line, GCC_INCLUDES" %s", freetype_include);
|
fm_add_to_line(line, GCC_INCLUDES" %s", freetype_include);
|
||||||
|
#else
|
||||||
|
fm_add_to_line(line, GCC_INCLUDES);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -565,7 +568,7 @@ package(char *cdir){
|
||||||
char *tier = tiers[tier_index];
|
char *tier = tiers[tier_index];
|
||||||
u32 flags = base_flags | tier_flags[tier_index];
|
u32 flags = base_flags | tier_flags[tier_index];
|
||||||
|
|
||||||
String_Temp temp = fm_begin_temp();
|
Temp_Memory temp = fm_begin_temp();
|
||||||
char *tier_package_root = fm_str(base_package_root, "_", tier);
|
char *tier_package_root = fm_str(base_package_root, "_", tier);
|
||||||
for (u32 arch = 0; arch < Arch_COUNT; ++arch){
|
for (u32 arch = 0; arch < Arch_COUNT; ++arch){
|
||||||
char *par_dir = fm_str(tier_package_root, "_", arch_names[arch]);
|
char *par_dir = fm_str(tier_package_root, "_", arch_names[arch]);
|
||||||
|
@ -619,7 +622,7 @@ package(char *cdir){
|
||||||
|
|
||||||
// NOTE(allen): power
|
// NOTE(allen): power
|
||||||
{
|
{
|
||||||
String_Temp temp = fm_begin_temp();
|
Temp_Memory temp = fm_begin_temp();
|
||||||
char *pack_power_par_dir = fm_str("../current_dist_power");
|
char *pack_power_par_dir = fm_str("../current_dist_power");
|
||||||
char *pack_power_dir = fm_str(pack_power_par_dir, "/power");
|
char *pack_power_dir = fm_str(pack_power_par_dir, "/power");
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
88
|
87
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,16 @@ Created 21.01.2017 (dd.mm.yyyy)
|
||||||
|
|
||||||
// TOP
|
// TOP
|
||||||
|
|
||||||
|
#include "../4cpp/4cpp_lexer.h"
|
||||||
|
// TODO(allen): Make sure to only publish the 4coder_string.h if it builds and passes a series of tests.
|
||||||
|
#define FSTRING_IMPLEMENTATION
|
||||||
|
#include "../4coder_lib/4coder_string.h"
|
||||||
|
|
||||||
|
#include "../4ed_defines.h"
|
||||||
|
#include "../meta/4ed_meta_defines.h"
|
||||||
|
#include "../meta/4ed_file_moving.h"
|
||||||
|
|
||||||
|
|
||||||
#define BUILD_NUMBER_FILE "4coder_string_build_num.txt"
|
#define BUILD_NUMBER_FILE "4coder_string_build_num.txt"
|
||||||
|
|
||||||
#define GENERATED_FILE "4coder_string.h"
|
#define GENERATED_FILE "4coder_string.h"
|
||||||
|
@ -14,16 +24,6 @@ Created 21.01.2017 (dd.mm.yyyy)
|
||||||
#define BACKUP_FOLDER ".." SLASH ".." SLASH "string_backup"
|
#define BACKUP_FOLDER ".." SLASH ".." SLASH "string_backup"
|
||||||
#define PUBLISH_FOLDER ".." SLASH "4coder_helper"
|
#define PUBLISH_FOLDER ".." SLASH "4coder_helper"
|
||||||
|
|
||||||
#include "../4cpp/4cpp_lexer.h"
|
|
||||||
// TODO(allen): Make sure to only publish the 4coder_string.h if it builds and passes a series of tests.
|
|
||||||
#define FSTRING_IMPLEMENTATION
|
|
||||||
#include "../4coder_lib/4coder_string.h"
|
|
||||||
|
|
||||||
#include "../4ed_defines.h"
|
|
||||||
#include "../meta/4ed_meta_defines.h"
|
|
||||||
|
|
||||||
#define FTECH_FILE_MOVING_IMPLEMENTATION
|
|
||||||
#include "../meta/4ed_file_moving.h"
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -158,12 +158,11 @@ print_function_body_code(String *out, Parse_Context *context, int32_t start){
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
file_move(char *path, char *file_name){
|
file_move(char *path, char *file_name){
|
||||||
fm_copy_file(fm_str(file_name), fm_str(path, file_name));
|
copy_file(0, file_name, path, 0, file_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
META_BEGIN();
|
META_BEGIN();
|
||||||
fm_init_system();
|
|
||||||
|
|
||||||
i32 size = (512 << 20);
|
i32 size = (512 << 20);
|
||||||
void *mem = malloc(size);
|
void *mem = malloc(size);
|
||||||
|
@ -468,11 +467,11 @@ int main(){
|
||||||
|
|
||||||
// NOTE(allen): Publish the new file. (Would like to be able to automatically test the result before publishing).
|
// NOTE(allen): Publish the new file. (Would like to be able to automatically test the result before publishing).
|
||||||
{
|
{
|
||||||
fm_make_folder_if_missing(BACKUP_FOLDER SLASH V_MAJ SLASH V_MIN);
|
make_folder_if_missing(BACKUP_FOLDER SLASH V_MAJ SLASH V_MIN, 0);
|
||||||
file_move(BACKUP_FOLDER SLASH V_MAJ SLASH V_MIN, INTERNAL_STRING);
|
file_move(BACKUP_FOLDER SLASH V_MAJ SLASH V_MIN, INTERNAL_STRING);
|
||||||
file_move(BACKUP_FOLDER SLASH V_MAJ SLASH V_MIN, GENERATED_FILE);
|
file_move(BACKUP_FOLDER SLASH V_MAJ SLASH V_MIN, GENERATED_FILE);
|
||||||
//file_move(PUBLISH_FOLDER, GENERATED_FILE);
|
//file_move(PUBLISH_FOLDER, GENERATED_FILE);
|
||||||
fm_delete_file(GENERATED_FILE);
|
delete_file(GENERATED_FILE);
|
||||||
printf("published "GENERATED_FILE": v%d.%d.%d\n", major_number, minor_number, build_number);
|
printf("published "GENERATED_FILE": v%d.%d.%d\n", major_number, minor_number, build_number);
|
||||||
save_build_number(BUILD_NUMBER_FILE, major_number, minor_number, build_number + 1);
|
save_build_number(BUILD_NUMBER_FILE, major_number, minor_number, build_number + 1);
|
||||||
}
|
}
|
||||||
|
@ -480,5 +479,8 @@ int main(){
|
||||||
META_FINISH();
|
META_FINISH();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define FTECH_FILE_MOVING_IMPLEMENTATION
|
||||||
|
#include "../meta/4ed_file_moving.h"
|
||||||
|
|
||||||
// BOTTOM
|
// BOTTOM
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue