Skip to content

Commit

Permalink
Added option to generate nasm code and build/test for part 46
Browse files Browse the repository at this point in the history
  • Loading branch information
the-grue committed Jan 4, 2023
1 parent 40422a1 commit 9463f59
Show file tree
Hide file tree
Showing 4 changed files with 874 additions and 2 deletions.
19 changes: 17 additions & 2 deletions 46_Void_Functions/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ HSRCS= data.h decl.h defs.h
SRCS= cg.c decl.c expr.c gen.c main.c misc.c \
opt.c scan.c stmt.c sym.c tree.c types.c

ARMSRCS= cg.c decl.c expr.c gen.c main.c misc.c \
SRCN= cgn.c decl.c expr.c gen.c main.c misc.c \
opt.c scan.c stmt.c sym.c tree.c types.c

ARMSRCS= cg_arm.c decl.c expr.c gen.c main.c misc.c \
opt.c scan.c stmt.c sym.c tree.c types.c

cwj: $(SRCS) $(HSRCS)
cc -o cwj -g -Wall -DINCDIR=\"$(INCDIR)\" $(SRCS)

compn: $(SRCN) $(HSRCS)
cc -D__NASM__ -o compn -g -Wall -DINCDIR=\"$(INCDIR)\" $(SRCN)

cwjarm: $(ARMSRCS) $(HSRCS)
cc -o cwjarm -g -Wall $(ARMSRCS)
cp cwjarm cwj
Expand All @@ -23,11 +29,20 @@ install: cwj
cp cwj $(BINDIR)
chmod +x $(BINDIR)/cwj

installn: compn
mkdir -p $(INCDIR)
rsync -a include/. $(INCDIR)
cp compn $(BINDIR)
chmod +x $(BINDIR)/compn

clean:
rm -f cwj cwjarm *.o *.s out a.out
rm -f cwj cwjarm compn *.o *.s out a.out

test: install tests/runtests
(cd tests; chmod +x runtests; ./runtests)

armtest: cwjarm tests/runtests
(cd tests; chmod +x runtests; ./runtests)

testn: installn tests/runtestsn
(cd tests; chmod +x runtestsn; ./runtestsn)
Loading

0 comments on commit 9463f59

Please sign in to comment.