Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #97 from kspalaiologos/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
kspalaiologos committed Oct 2, 2020
2 parents d4d8511 + 6db2233 commit 357c84d
Show file tree
Hide file tree
Showing 41 changed files with 7,641 additions and 347 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ root = true
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = tab
indent_style = space
indent_size = 4
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@ hla/parser.tab.c
hla/parser.tab.h

hla/parser.output

autom4te.cache/

Makefile

config.status

config.h

config.log
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ matrix:
include:
- language: c
script:
- sudo make all setup
- ./configure && sudo make all setup
- language: c
script:
- sudo make COVERAGE="-g -coverage -DBFI_NOCHECKS -O0" all setup test
- ./configure && sudo make COVERAGE="-g -coverage -DBFI_NOCHECKS -O0" all setup test
after_success:
- bash <(curl -s https://codecov.io/bash)
cache: apt
44 changes: 17 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Kamila Szewczyk, Jul 2019

export CFLAGS=-Ofast -march=native -funroll-loops -fomit-frame-pointer -w $(COVERAGE) $(OPTIONS)
export CFLAGS=-Ofast -march=native -funroll-loops -fomit-frame-pointer -w $(COVERAGE)
TARGETS=bfasm bfvm bfi bconv bfstrip bfderle bflabels constpp bfdata effective vxcall

.PHONY: all clean setup test bfpp
Expand All @@ -31,7 +31,7 @@ test: test/*.asm

clean:
rm -rf bin/
rm -f effective.c constpp.c bflabels.c bfdata.c
rm -f preprocessor/*.c
cd bfpp && make clean && cd ..

etc/bfasm.b: bfasm bfstrip etc/bfasm.asm
Expand All @@ -49,32 +49,22 @@ test-clean:
rm -f test/*.aout
rm -f test/*.b

bflabels: bflabels.c
$(CC) $(CFLAGS) $^ -o $@
bflabels: preprocessor/bflabels.lex
lex -f -o preprocessor/bflabels.c $^
$(CC) $(CFLAGS) preprocessor/bflabels.c -o $@

bflabels.c: bflabels.lex
lex -f -o $@ $^
effective: preprocessor/effective.lex
lex -f -o preprocessor/effective.c $^
$(CC) $(CFLAGS) preprocessor/effective.c -o $@

effective: effective.c
$(CC) $(CFLAGS) $^ -o $@
constpp: preprocessor/constpp.lex
lex -f -o preprocessor/constpp.c $^
$(CC) $(CFLAGS) preprocessor/constpp.c -o $@

effective.c: effective.lex
lex -f -o $@ $^
bfdata: preprocessor/bfdata.lex
lex -f -o preprocessor/bfdata.c $^
$(CC) $(CFLAGS) preprocessor/bfdata.c -o $@

constpp: constpp.c
$(CC) $(CFLAGS) $^ -o $@

constpp.c: constpp.lex
lex -f -o $@ $^

bfdata: bfdata.c
$(CC) $(CFLAGS) $^ -o $@

bfdata.c: bfdata.lex
lex -f -o $@ $^

vxcall: vxcall.c
$(CC) $(CFLAGS) $^ -o $@

vxcall.c: vxcall.lex
lex -f -o $@ $^
vxcall: preprocessor/vxcall.lex
lex -f -o preprocessor/vxcall.c $^
$(CC) $(CFLAGS) preprocessor/vxcall.c -o $@
70 changes: 70 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

# This file could have been written in more
# elegant manner, but I'm fine with it's current
# state.

# Kamila Szewczyk, Jul 2019

export CFLAGS=-Ofast -march=native -funroll-loops -fomit-frame-pointer -w $(COVERAGE)
TARGETS=bfasm bfvm bfi bconv bfstrip bfderle bflabels constpp bfdata effective vxcall

.PHONY: all clean setup test bfpp

all: $(TARGETS) bfpp etc/bfasm.b bin

setup:
rm -rf "${HOME}/.asmbf/"
mkdir -p "${HOME}/.asmbf/"
cp -rf bin/asmbf/* "${HOME}/.asmbf/"
chmod -R a+x "${HOME}/.asmbf/"
echo "asm2bf has been installed to ${HOME}/.asmbf/."

bfpp:
make -C bfpp

test: test/*.asm
chmod a+x test/test.pl $^
-bfi --help 2> /dev/null
-bfi --version 2> /dev/null
-bfi --blah 2> /dev/null
test/test.pl $^

clean:
rm -rf bin/
rm -f preprocessor/*.c
cd bfpp && make clean && cd ..

etc/bfasm.b: bfasm bfstrip etc/bfasm.asm
./bfasm < etc/bfasm.asm | ./bfstrip > $@

bin: $(TARGETS)
mkdir -p bin
mkdir -p bin/asmbf
mkdir -p bin/asmbf/lib
cp $(TARGETS) bfpp/bfpp bfmake bfi-rle bin/asmbf/
cp lib-bfm.lua bin/asmbf/lib/
rm -rf $(TARGETS)

test-clean:
rm -f test/*.aout
rm -f test/*.b

bflabels: preprocessor/bflabels.lex
lex -f -o preprocessor/bflabels.c $^
$(CC) $(CFLAGS) preprocessor/bflabels.c -o $@

effective: preprocessor/effective.lex
lex -f -o preprocessor/effective.c $^
$(CC) $(CFLAGS) preprocessor/effective.c -o $@

constpp: preprocessor/constpp.lex
lex -f -o preprocessor/constpp.c $^
$(CC) $(CFLAGS) preprocessor/constpp.c -o $@

bfdata: preprocessor/bfdata.lex
lex -f -o preprocessor/bfdata.c $^
$(CC) $(CFLAGS) preprocessor/bfdata.c -o $@

vxcall: preprocessor/vxcall.lex
lex -f -o preprocessor/vxcall.c $^
$(CC) $(CFLAGS) preprocessor/vxcall.c -o $@
8 changes: 5 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ for your use. Precise floating point library is on the board, memory allocation
inlining. Last changes include stack-based offsets, virtual instructions and effective adresses. Why not
check it out?

manual.pdf - WIP, UP TO DATE ASM2BF MANUAL AND DOCUMENTATION.
https://discord.gg/m4Wcenn - THE DISCORD SERVER FOR ASM2BF.
http://kspalaiologos.now.im/doc/asmbf9.pdf - WIP, UP TO DATE ASM2BF MANUAL AND DOCUMENTATION.
https://discord.gg/m4Wcenn - THE DISCORD SERVER FOR ASM2BF.

https://esolangs.org/wiki/Asm2bf - in-depth explanation of asm2bf inner workings and programming techniques.
serves as a documentation aswell. article.txt contains a mirror of this article.
it is a bit outdated (check section "State-of-art Documentation"), but it may
prove itself useful.

examples/ - who doesn't love learning by examples?
test/ - unit tests for the entire toolchain.

Expand Down Expand Up @@ -55,7 +57,7 @@ $(bf_wend("r2"))
--------------------------------------- Installation Instruction ---------------------------------------

1. Pull the repository from github: `git clone https://github.com/kspalaiologos/asmbf'
2. Build asm2bf: `make all'
2. Run the configure script and build asm2bf: `./configure & make all`
3. Drop asm2bf into your home directory: `make setup'
4. Optional: Add `~/.asmbf' into your PATH.

Expand Down
1 change: 1 addition & 0 deletions bconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

#include <stdio.h>
#include "config.h"

int main(void) {
int c;
Expand Down
Loading

0 comments on commit 357c84d

Please sign in to comment.