Wrote a basic lexer

This commit is contained in:
2022-08-03 09:35:20 +01:00
parent 3cbf7b13eb
commit 3cad70dddd
12 changed files with 884 additions and 0 deletions

27
source/makefile Normal file
View File

@@ -0,0 +1,27 @@
CC=gcc
IDIR =.
CFLAGS=$(addprefix -I,$(IDIR)) -g -Wall -W -pedantic
LIBS=
ODIR=obj
SRC = $(wildcard *.c)
OBJ = $(addprefix $(ODIR)/,$(SRC:.c=.o))
OUT = ../$(OUTDIR)/toy
all: $(OBJ)
$(CC) -o $(OUT) $^ $(CFLAGS) $(LIBS)
$(OBJ): | $(ODIR)
$(ODIR):
mkdir $(ODIR)
$(ODIR)/%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
.PHONY: clean
clean:
$(RM) $(ODIR)