Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
1.0
Browse files Browse the repository at this point in the history
Bugfixes
Fixed a bug in CLS
Added the ability to clear a single line in CLS
Added subfunctions
Switched from double to long double
Rewrote getVal() and improved accuracy
Fixed getVal() power solving bug due to rewrite
Windows now uses CreateProcess() instead of system() for EXEC, EXEC(), and EXEC$()
Fixed Windows _kbhit()
  • Loading branch information
PQCraft committed Dec 3, 2021
1 parent 4de54f6 commit b5913ee
Show file tree
Hide file tree
Showing 9 changed files with 1,365 additions and 1,019 deletions.
25 changes: 13 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
ifndef CC
CC = gcc
endif

BASE_CFLAGS = --std=c99 -Wall -Wextra -Ofast -lm -lreadline -funsigned-char

ifndef OS

C = gcc
CFLAGS = $(BASE_CFLAGS) -ldl
ifeq ($(shell uname -s), Darwin)
ifeq ($(shell [ -d ~/.brew/opt/readline/include ] && echo true), true)
Expand All @@ -27,18 +30,18 @@ else
ifeq ($(shell uname -o), Android)
CFLAGS += -s
else
CFLAGS += -s -no-pie
CFLAGS += -g -no-pie
endif
endif

CBITS = $(shell getconf LONG_BIT)

BUILD_TO = clibasic
BUILD32 = $(C) clibasic.c -m32 $(CFLAGS) -DB32 -o $(BUILD_TO) && chmod +x $(BUILD_TO)
BUILD32 = $(CC) clibasic.c -m32 $(CFLAGS) -DB32 -o $(BUILD_TO) && chmod +x $(BUILD_TO)
ifeq (,$(CBITS))
BUILD__ = $(BUILD32)
else
BUILD__ = $(C) clibasic.c $(CFLAGS) -DB$(CBITS) -o $(BUILD_TO) && chmod +x $(BUILD_TO)
BUILD__ = $(CC) clibasic.c $(CFLAGS) -DB$(CBITS) -o $(BUILD_TO) && chmod +x $(BUILD_TO)
endif

MAN_PATH = docs/clibasic.man
Expand Down Expand Up @@ -103,7 +106,7 @@ cross:
ifeq ($(MAKECMDGOALS), cross)
@$(MAKE) cross all
else
@$(eval C = x86_64-w64-mingw32-gcc)
@$(eval CC = x86_64-w64-mingw32-gcc)
@$(eval C32 = i686-w64-mingw32-gcc)
@$(eval CFLAGS = $(BASE_CFLAGS) -s -Ilib)
@$(eval BUILD_TO = clibasic.exe)
Expand All @@ -113,7 +116,7 @@ else
ifeq (,$(CBITS))
@$(eval BUILD__ = $(BUILD32))
else
@$(eval BUILD__ = cp -f lib/win64/*.dll . && $(C) clibasic.c $(CFLAGS) -Llib/win64 -DB$(CBITS) -o $(BUILD_TO) && chmod -x $(BUILD_TO))
@$(eval BUILD__ = cp -f lib/win64/*.dll . && $(CC) clibasic.c $(CFLAGS) -Llib/win64 -DB$(CBITS) -o $(BUILD_TO) && chmod -x $(BUILD_TO))
endif
@$(eval RUN = wineconsole .\\$(BUILD_TO))
@$(eval CLEAN = rm -f clibasic.exe *.dll)
Expand All @@ -126,19 +129,17 @@ vt:
ifeq (,$(CBITS))
@$(eval BUILD__ = $(BUILD32))
else
@$(eval BUILD__ = cp -f lib/win64/*.dll . && $(C) clibasic.c $(CFLAGS) -Llib/win64 -DB$(CBITS) -o $(BUILD_TO) && chmod -x $(BUILD_TO))
@$(eval BUILD__ = cp -f lib/win64/*.dll . && $(CC) clibasic.c $(CFLAGS) -Llib/win64 -DB$(CBITS) -o $(BUILD_TO) && chmod -x $(BUILD_TO))
endif
@true

else

C = gcc

CFLAGS = $(BASE_CFLAGS) -Ilib -s -D_CRT_NONSTDC_NO_WARNINGS
CFLAGS = $(BASE_CFLAGS) -lpthread -Ilib -s -D_CRT_NONSTDC_NO_WARNINGS

BUILD_TO = clibasic.exe
BUILD64 = xcopy lib\win64\*.dll . /Y && $(C) clibasic.c -m64 $(CFLAGS) -Llib\win64 -DB64 -o $(BUILD_TO)
BUILD32 = xcopy lib\win32\*.dll . /Y && $(C) clibasic.c -m32 $(CFLAGS) -Llib\win32 -DB32 -o $(BUILD_TO)
BUILD64 = xcopy lib\win64\*.dll . /Y && $(CC) clibasic.c -m64 $(CFLAGS) -Llib\win64 -DB64 -o $(BUILD_TO)
BUILD32 = xcopy lib\win32\*.dll . /Y && $(CC) clibasic.c -m32 $(CFLAGS) -Llib\win32 -DB32 -o $(BUILD_TO)

INSTALL_TO = C:\windows\system32
INSTALL = xcopy *.dll $(INSTALL_TO) /Y && xcopy $(BUILD_TO) $(INSTALL_TO) /Y
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ To run, use `make run` or `./clibasic`. <br>
To build then run, use `make` (same as `make all`). <br>
To build CLIBASIC with support for VT escape codes, add `vt` before the rest of the rules. <br>

---
### Demo <br>
[![asciicast](https://asciinema.org/a/447773.png)](https://asciinema.org/a/447773)

---
### Notes <br>
- On Arch Linux, you can install CLIBASIC by installing either the [`clibasic`](https://aur.archlinux.org/packages/clibasic/) or [`clibasic-bin`](https://aur.archlinux.org/packages/clibasic-bin/) AUR package.
Expand All @@ -87,4 +91,3 @@ To build CLIBASIC with support for VT escape codes, add `vt` before the rest of
- CLIBASIC will look for `~/.clibasicrc`, `~/autorun.bas`, then `~/.autorun.bas` in this order in the user's home directory and run the first file found.
- The development scripts are `build.sh` which is for testing if CLIBASIC compiles correctly for Linux and Windows, `package.sh` which creates the zip files for making a CLIBASIC release, `commit.sh` which automates the build and push process, and `release-text.sh` which generates the text for making a CLIBASIC release.
- Include the `clibasic.h` file when making a clibasic extension.

Loading

0 comments on commit b5913ee

Please sign in to comment.