added ptxgen
This commit is contained in:
@@ -1,26 +1,49 @@
|
||||
all: ptxcc
|
||||
all: ptxcc ptxgen
|
||||
|
||||
CXX=clang++
|
||||
CXXFLAGS += -O3
|
||||
CXXFLAGS += -I/opt/local/include
|
||||
|
||||
LD=clang++
|
||||
LDFLAGS += -L/opt/local/lib
|
||||
|
||||
FLEX=flex
|
||||
BISON=bison
|
||||
|
||||
CUDATK=/usr/local/cuda
|
||||
LIBDEVICE_MAJOR=1
|
||||
LIBDEVICE_MINOR=0
|
||||
|
||||
ptxgrammar.cc : ptxgrammar.yy
|
||||
bison -d -v -t ptxgrammar.yy -o ptxgrammar.cc
|
||||
$(BISON) -d -v -t ptxgrammar.yy -o ptxgrammar.cc
|
||||
|
||||
ptx.cc: ptx.ll ptxgrammar.cc
|
||||
flex -t ptx.ll > ptx.cc
|
||||
$(FLEX) -t ptx.ll > ptx.cc
|
||||
|
||||
%.o: %.cc
|
||||
clang++ -O3 -c $< -o $@ -I/opt/local/include
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
%.o: %.cpp
|
||||
clang++ -O3 -c $< -o $@ -I/opt/local/include
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
OBJ= ptxcc.o \
|
||||
ptx.o \
|
||||
ptxgrammar.o
|
||||
|
||||
ptxcc: $(OBJ)
|
||||
clang++ $^ -o $@ -L/opt/local/lib
|
||||
$(LD) $(LDFLAGS) $^ -o $@
|
||||
|
||||
ptxgen: ptxgen.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ $< \
|
||||
-L$(CUDATK)/nvvm/lib64 -lnvvm \
|
||||
-I$(CUDATK)/nvvm/include \
|
||||
-I$(CUDATK)/include \
|
||||
-DLIBDEVICE_MAJOR_VERSION=$(LIBDEVICE_MAJOR) \
|
||||
-DLIBDEVICE_MINOR_VERSION=$(LIBDEVICE_MINOR) \
|
||||
-DLIBNVVM_HOME=$(CUDATK)/nvvm -Wl,-rpath,$(CUDATK)/nvvm/lib64
|
||||
|
||||
clean:
|
||||
/bin/rm -f ptxcc $(OBJ) ptxgrammar.hh ptxgrammar.cc ptx.cc ptxgrammar.output
|
||||
/bin/rm -f ptxgen ptxcc $(OBJ) ptxgrammar.hh ptxgrammar.cc ptx.cc ptxgrammar.output
|
||||
|
||||
$(OBJ): ptxgrammar.cc ptx.cc PTXParser.h PTXLexer.h
|
||||
|
||||
|
||||
Reference in New Issue
Block a user