Updated package setup for new site system and for linux

master
Allen Webster 2016-12-27 15:04:41 -05:00
parent 9f8a00169c
commit 7ef5e5e118
3 changed files with 42 additions and 35 deletions

View File

@ -118,14 +118,14 @@ typedef union _LARGE_INTEGER {
extern "C"{ extern "C"{
DWORD WINAPI GetCurrentDirectoryA(_In_ DWORD nBufferLength, _Out_ LPTSTR lpBuffer); DWORD WINAPI GetCurrentDirectoryA(_In_ DWORD nBufferLength, _Out_ LPTSTR lpBuffer);
BOOL WINAPI SetCurrentDirectoryA(_In_ LPCTSTR lpPathName); BOOL WINAPI SetCurrentDirectoryA(_In_ LPCTSTR lpPathName);
BOOL WINAPI QueryPerformanceCounter(_Out_ LARGE_INTEGER *lpPerformanceCount); BOOL WINAPI QueryPerformanceCounter(_Out_ LARGE_INTEGER *lpPerformanceCount);
BOOL WINAPI QueryPerformanceFrequency(_Out_ LARGE_INTEGER *lpFrequency); BOOL WINAPI QueryPerformanceFrequency(_Out_ LARGE_INTEGER *lpFrequency);
BOOL WINAPI CreateDirectoryA(_In_ LPCTSTR lpPathName, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes); BOOL WINAPI CreateDirectoryA(_In_ LPCTSTR lpPathName, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes);
BOOL WINAPI CopyFileA(_In_ LPCTSTR lpExistingFileName, _In_ LPCTSTR lpNewFileName, _In_ BOOL bFailIfExists); BOOL WINAPI CopyFileA(_In_ LPCTSTR lpExistingFileName, _In_ LPCTSTR lpNewFileName, _In_ BOOL bFailIfExists);
} }
static uint64_t perf_frequency; static uint64_t perf_frequency;
@ -173,7 +173,7 @@ execute(char *dir, char *str, char *args){
if (dir){ if (dir){
Temp_Dir temp = pushdir(dir); Temp_Dir temp = pushdir(dir);
if (args){ if (args){
systemf("call \"%s\" %s", str, args); systemf("call \"%s\" %s", str, args);
} }
else{ else{
systemf("call \"%s\"", str); systemf("call \"%s\"", str);
@ -193,11 +193,11 @@ execute(char *dir, char *str, char *args){
static void static void
slash_fix(char *path){ slash_fix(char *path){
if (path){ if (path){
for (int32_t i = 0; path[i]; ++i){ for (int32_t i = 0; path[i]; ++i){
if (path[i] == '/') path[i] = '\\'; if (path[i] == '/') path[i] = '\\';
}
} }
} }
}
static void static void
make_folder_if_missing(char *dir, char *folder){ make_folder_if_missing(char *dir, char *folder){
@ -207,8 +207,8 @@ make_folder_if_missing(char *dir, char *folder){
String path = make_fixed_width_string(space); String path = make_fixed_width_string(space);
append_sc(&path, dir); append_sc(&path, dir);
if (folder){ if (folder){
append_sc(&path, "\\"); append_sc(&path, "\\");
append_sc(&path, folder); append_sc(&path, folder);
} }
terminate_with_null(&path); terminate_with_null(&path);
@ -267,7 +267,7 @@ copy_all(char *source, char *tag, char *folder){
slash_fix(source); slash_fix(source);
slash_fix(folder); slash_fix(folder);
if (source){ if (source){
systemf("copy %s\\%s %s\\*", source, tag, folder); systemf("copy %s\\%s %s\\*", source, tag, folder);
} }
else{ else{
systemf("copy %s %s\\*", tag, folder); systemf("copy %s %s\\*", tag, folder);
@ -340,9 +340,9 @@ static void
execute(char *dir, char *str, char *args){ execute(char *dir, char *str, char *args){
if (dir){ if (dir){
if (args){ if (args){
Temp_Dir temp = pushdir(dir); Temp_Dir temp = pushdir(dir);
systemf("%s %s", str, args); systemf("%s %s", str, args);
popdir(temp); popdir(temp);
} }
else{ else{
Temp_Dir temp = pushdir(dir); Temp_Dir temp = pushdir(dir);
@ -352,7 +352,7 @@ execute(char *dir, char *str, char *args){
} }
else{ else{
if (args){ if (args){
systemf("%s %s", str, args); systemf("%s %s", str, args);
} }
else{ else{
systemf("%s", str); systemf("%s", str);
@ -366,7 +366,7 @@ slash_fix(char *path){}
static void static void
make_folder_if_missing(char *dir, char *folder){ make_folder_if_missing(char *dir, char *folder){
if (folder){ if (folder){
systemf("mkdir -p %s/%s", dir, folder); systemf("mkdir -p %s/%s", dir, folder);
} }
else{ else{
systemf("mkdir -p %s", dir); systemf("mkdir -p %s", dir);
@ -386,7 +386,7 @@ copy_file(char *path, char *file, char *folder1, char *folder2, char *newname){
if (path){ if (path){
if (folder2){ if (folder2){
systemf("cp %s/%s %s/%s/%s", path, file, folder1, folder2, newname); systemf("cp %s/%s %s/%s/%s", path, file, folder1, folder2, newname);
} }
else{ else{
systemf("cp %s/%s %s/%s", path, file, folder1, newname); systemf("cp %s/%s %s/%s", path, file, folder1, newname);
@ -405,7 +405,7 @@ copy_file(char *path, char *file, char *folder1, char *folder2, char *newname){
static void static void
copy_all(char *source, char *tag, char *folder){ copy_all(char *source, char *tag, char *folder){
if (source){ if (source){
systemf("cp -rf %s/%s %s", source, tag, folder); systemf("cp -rf %s/%s %s", source, tag, folder);
} }
else{ else{
systemf("cp -rf %s %s", tag, folder); systemf("cp -rf %s %s", tag, folder);
@ -895,28 +895,28 @@ do_buildsuper(char *cdir, int32_t custom_option){
case Custom_Default: case Custom_Default:
{ {
copy_sc(&str, "../code/4coder_default_bindings.cpp"); copy_sc(&str, "../code/4coder_default_bindings.cpp");
terminate_with_null(&str); terminate_with_null(&str);
buildsuper(cdir, BUILD_DIR, str.str); buildsuper(cdir, BUILD_DIR, str.str);
}break; }break;
case Custom_Experiments: case Custom_Experiments:
{ {
#if defined(IS_WINDOWS) #if defined(IS_WINDOWS)
copy_sc(&str, "../code/internal_4coder_tests.cpp"); copy_sc(&str, "../code/internal_4coder_tests.cpp");
terminate_with_null(&str); terminate_with_null(&str);
buildsuper(cdir, BUILD_DIR, str.str); buildsuper(cdir, BUILD_DIR, str.str);
#else #else
copy_sc(&str, "../code/power/4coder_experiments.cpp"); copy_sc(&str, "../code/power/4coder_experiments.cpp");
terminate_with_null(&str); terminate_with_null(&str);
buildsuper(cdir, BUILD_DIR, str.str); buildsuper(cdir, BUILD_DIR, str.str);
#endif #endif
}break; }break;
case Custom_Casey: case Custom_Casey:
{ {
copy_sc(&str, "../code/power/4coder_casey.cpp"); copy_sc(&str, "../code/power/4coder_casey.cpp");
terminate_with_null(&str); terminate_with_null(&str);
buildsuper(cdir, BUILD_DIR, str.str); buildsuper(cdir, BUILD_DIR, str.str);
}break; }break;
case Custom_ChronalVim: case Custom_ChronalVim:
@ -1070,7 +1070,7 @@ package(char *cdir){
get_4coder_dist_name(&str, 0, "API", "html"); get_4coder_dist_name(&str, 0, "API", "html");
str2 = front_of_directory(str); str2 = front_of_directory(str);
copy_file(SITE_DIR, "4coder_API.html", PACK_DIR, "super-docs", str2.str); copy_file(SITE_DIR, "custom_docs.html", PACK_DIR, "super-docs", str2.str);
get_4coder_dist_name(&str, 1, "super", "zip"); get_4coder_dist_name(&str, 1, "super", "zip");
zip(PACK_SUPER_PAR_DIR, "4coder", str.str); zip(PACK_SUPER_PAR_DIR, "4coder", str.str);

7
package.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
WARNINGS="-Wno-write-strings"
FLAGS="-D_GNU_SOURCE -fPIC -fpermissive -DPACKAGE"
g++ $WARNINGS $FLAGS build.cpp -g -o ../build/build
../build/build

View File

@ -8,7 +8,7 @@ fkey_command_win[4] = {0, 0};
fkey_command_win[5] = {0, 0}; fkey_command_win[5] = {0, 0};
fkey_command_win[6] = {0, 0}; fkey_command_win[6] = {0, 0};
fkey_command_win[7] = {0, 0}; fkey_command_win[7] = {0, 0};
fkey_command_win[8] = {"package.bat", "*compilation*", true}; fkey_command_win[8] = {"package.bat", "*package*"};
fkey_command_win[9] = {0, 0}; fkey_command_win[9] = {0, 0};
fkey_command_win[10] = {0, 0}; fkey_command_win[10] = {0, 0};
fkey_command_win[11] = {0, 0}; fkey_command_win[11] = {0, 0};
@ -18,14 +18,14 @@ fkey_command_win[14] = {0, 0};
fkey_command_win[15] = {0, 0}; fkey_command_win[15] = {0, 0};
fkey_command_win[16] = {0, 0}; fkey_command_win[16] = {0, 0};
fkey_command_linux[1] = {"make", "*compilation*", true}; fkey_command_linux[1] = {"./build.sh", "*compilation*", true};
fkey_command_linux[2] = {"../build/4ed", "*run*"}; fkey_command_linux[2] = {"../build/4ed", "*run*"};
fkey_command_linux[3] = {"site/build.sh", "*compilation*", true}; fkey_command_linux[3] = {"site/build.sh", "*compilation*", true};
fkey_command_linux[4] = {0, 0}; fkey_command_linux[4] = {0, 0};
fkey_command_linux[5] = {0, 0}; fkey_command_linux[5] = {0, 0};
fkey_command_linux[6] = {0, 0}; fkey_command_linux[6] = {0, 0};
fkey_command_linux[7] = {0, 0}; fkey_command_linux[7] = {0, 0};
fkey_command_linux[8] = {"package.sh", "*compilation*", true}; fkey_command_linux[8] = {"./package.sh", "*package*"};
fkey_command_linux[9] = {0, 0}; fkey_command_linux[9] = {0, 0};
fkey_command_linux[10] = {0, 0}; fkey_command_linux[10] = {0, 0};
fkey_command_linux[11] = {0, 0}; fkey_command_linux[11] = {0, 0};