Skip to content

Commit

Permalink
Merge pull request ghaerr#2046 from ghaerr/yacc
Browse files Browse the repository at this point in the history
[cmds] Remove yacc requirement for building bc
  • Loading branch information
ghaerr authored Sep 28, 2024
2 parents 43af7bb + bb61232 commit 2050209
Show file tree
Hide file tree
Showing 5 changed files with 4,901 additions and 12 deletions.
3 changes: 0 additions & 3 deletions elkscmd/bc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
bc
bc.c
fbc
math.h
scan.c
y.tab.h
23 changes: 14 additions & 9 deletions elkscmd/bc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,25 @@ OFILES = scan.o util.o main.o number.o storage.o load.o execute.o

SUBDIRS = Examples Test

all: fbc bc
all: bc

bc: $& config.h bc.o $(OFILES) global.o
$(LD) -o bc $(LDFLAGS) bc.o $(OFILES) global.o $(LDLIBS)

sbc: sbc.o $(OFILES) global.o
$(LD) -o sbc $(LDFLAGS) sbc.o $(OFILES) global.o $(LDLIBS)

install: bc fbc
$(INSTALL) bc $(DESTDIR)/bin
# $(INSTALL) fbc $(DESTDIR)/bin

clean:
$(RM) *.o *.bak math.h bc fbc sbc

realclean: clean
$(RM) sbc.c bc.c scan.c y.tab.h

ifdef UNUSED
math.h: libmath.b
$(MAKE) -$(MAKEFLAGS) fbc
elksemu ./fbc -c libmath.b </dev/null >math.h
Expand All @@ -55,13 +66,6 @@ fbc: $(OFILES) bc.o
$(CC) -c $(CFLAGS) global.c
$(LD) -o fbc $(LDFLAGS) bc.o $(OFILES) global.o $(LDLIBS)

install: bc fbc
$(INSTALL) bc $(DESTDIR)/bin
# $(INSTALL) fbc $(DESTDIR)/bin

clean:
$(RM) *.o *.bak math.h bc fbc sbc bc.c sbc.c scan.c y.tab.h

scan.c: scan.l
$(LEX) scan.l
mv lex.yy.c scan.c
Expand All @@ -74,8 +78,9 @@ y.tab.h bc.c: bc.y
sbc.c: sbc.y
$(YACC) -d sbc.y
mv y.tab.c sbc.c
endif

global.o: bcdefs.h global.h math.h
global.o: bcdefs.h global.h
bc.o: bcdefs.h global.h
execute.o: bcdefs.h global.h
load.o: bcdefs.h global.h
Expand Down
Loading

0 comments on commit 2050209

Please sign in to comment.