Skip to content

Commit

Permalink
Improved structure on build through build script file.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Nov 30, 2024
1 parent 17b7bdb commit 23b20a2
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,34 @@
import shutil
import subprocess

PLATFORM = platform.system()

CORE_VERSION = '1.0.0'
OUT_DIR = 'dist'

if os.path.exists(OUT_DIR):
shutil.rmtree(OUT_DIR)

OUT_DIR = os.path.join(OUT_DIR, 'n8lang')
os.makedirs(OUT_DIR)

OUTPUT_EXECUTABLE = os.path.join(OUT_DIR, 'n8')
OUTPUT_LIBRARY = os.path.join(OUT_DIR, 'n8-std')
OUTPUT_CORE = OUTPUT_LIBRARY + '-core.a'
try:
src = 'modules'

shutil.copytree(src, os.path.join(OUT_DIR, os.path.basename(src)), dirs_exist_ok=True)
print(f"Successfully copied '{src}' to '{OUT_DIR}'")

except Exception as e:
print("Failed to copy modules.")
exit(0)

PLATFORM = platform.system()
OUTPUT_EXECUTABLE = os.path.join(OUT_DIR, 'bin')
OUTPUT_LIBRARY = os.path.join(OUT_DIR, 'modules', 'core@' + CORE_VERSION, 'lib')

os.makedirs(OUTPUT_EXECUTABLE)
os.makedirs(OUTPUT_LIBRARY)

OUTPUT_EXECUTABLE = os.path.join(OUTPUT_EXECUTABLE, 'n8')
OUTPUT_LIBRARY = os.path.join(OUTPUT_LIBRARY, 'n8-std')

cpp_files = []
cc_files = []
Expand Down

0 comments on commit 23b20a2

Please sign in to comment.