Replace build script with Makefile and fix bug.

Signed-off-by: xSlendiX <slendi@socopon.com>
This commit is contained in:
xSlendiX 2022-12-18 11:07:52 +02:00
parent cbf25efcd0
commit e7a028bd75
5 changed files with 34 additions and 10 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
tbuild
main.o

29
Makefile Normal file
View File

@ -0,0 +1,29 @@
CC=tcc
CFLAGS=-O0 -ggdb -Wall
.PHONY: all clean install
all: tbuild
tbuild: main.o tomlc99/toml.o
$(CC) $(CFLAGS) tomlc99/toml.o main.o -o tbuild
main.o: main.c
$(CC) $(CFLAGS) -c main.c -o main.o
tomlc99/toml.o:
cd tomlc99 && $(MAKE) && cd ..
clean:
rm -f tbuild main.o tomlc99/toml.o
install:
ifeq ($(OS),Windows_NT)
mkdir "C:\tbuild" ; \
copy tbuild "C:\tbuild" ; \
copy RedSeaGen.exe "C:\tbuild" ;
else
install tbuild /usr/local/bin
install RedSeaGen /usr/local/bin
endif

View File

@ -5,9 +5,7 @@ conversion for ZealOS and dependency management.
## Building and installing
To build and install, simply run `./build.sh`. After it has finished compiling,
you can put the built `tbuild` binary anywhere in your PATH. Make sure you also
put in the same directory the corresponding RedSeaGen binary for your system.
To build, simply run `make`. After it has finished compiling, you can run `make install` to install the resulting binary into your system.
## Usage

View File

@ -1,4 +0,0 @@
cd tomlc99
make
cd ..
cc tomlc99/toml.o main.c -o tbuild -O0 -ggdb

6
main.c
View File

@ -874,11 +874,11 @@ Del(\"C:/Apps/Wordle/RunCD.*\");\n\
char *iso_c = malloc((strlen(buffer_text_format)+1)*sizeof(char));
strcpy(iso_c, buffer_text_format);
#if defined(_WIN32)
system(text_format("%s/RedSeaGen.exe '%s' '%s'", abs_exe_path, build_dir, iso_c));
system(text_format("RedSeaGen.exe '%s' '%s'", build_dir, iso_c));
#else
system(text_format("%s/RedSeaGen '%s' '%s'", abs_exe_path, build_dir, iso_c));
system(text_format("RedSeaGen '%s' '%s'", build_dir, iso_c));
#endif
//abs_exe_path,
free(build_dir);
free(out_dir);
free(scripts_dir);