Skip to content

Commit

Permalink
Chapter 4: update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaiklor committed Mar 21, 2017
1 parent 1e728f6 commit e3209d5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
SOURCES = $(shell find ast lexer logger parser -name '*.cpp')
HEADERS = $(shell find ast lexer logger parser -name '*.h')
OBJ = ${SOURCES:.cpp=.o}
CC = llvm-g++

CFLAGS = -g -O3 -stdlib=libc++ -std=c++11 -I llvm/include -I llvm/build/include
LLVMFLAGS = `/usr/local/Cellar/llvm/3.9.1_1/bin/llvm-config --cxxflags --ldflags --system-libs --libs core`

.PHONY: compile

compile:
llvm-g++ -g -O3 -stdlib=libc++ -std=c++11 `/usr/local/Cellar/llvm/3.9.1_1/bin/llvm-config --cxxflags --ldflags --system-libs --libs core` -I llvm/include -I llvm/build/include lexer.cpp -o lexer.out
compile: ${OBJ}

%.o: %.cpp ${HEADERS}
${CC} ${CFLAGS} ${LLVMFLAGS} -c $< -o $@

0 comments on commit e3209d5

Please sign in to comment.