Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (20 sloc) 548 Bytes
all: parser
OBJS = parser.o \
codegen.o \
main.o \
tokens.o \
LLVM_MODULES = core jit native
CPPFLAGS = `llvm-config --cppflags $(LLVM_MODULES)`
LDFLAGS = `llvm-config --ldflags $(LLVM_MODULES)`
LIBS = `llvm-config --libs $(LLVM_MODULES)`
clean:
$(RM) -rf parser.cpp parser.hpp parser tokens.cpp $(OBJS)
parser.cpp: parser.y
bison -d -o $@ $^
parser.hpp: parser.cpp
tokens.cpp: tokens.l parser.hpp
flex -o $@ $^
%.o: %.cpp
g++ -c $(CPPFLAGS) -o $@ $<
parser: $(OBJS)
g++ -o $@ $(LDFLAGS) $(OBJS) $(LIBS)