1 2TOP = ../../../.. 3include $(TOP)/configs/current 4 5include Makefile.sources 6 7LIBNAME = radeon 8 9LIBRARY_INCLUDES = -I$(TOP)/include 10 11TBLGEN = $(LLVM_BINDIR)/llvm-tblgen 12 13CXXFLAGS+= $(LLVM_CXXFLAGS) 14 15include ../../Makefile.template 16 17CXXFLAGS := $(filter-out -DDEBUG, $(CXXFLAGS)) 18 19tablegen = $(TBLGEN) -I $(LLVM_INCLUDEDIR) $1 $2 -o $3 20 21HAVE_LLVM_INTRINSICS = $(shell grep IntrinsicsR600.td $(LLVM_INCLUDEDIR)/llvm/Intrinsics.td) 22 23SIRegisterInfo.td: SIGenRegisterInfo.pl 24 $(PERL) $^ > $@ 25 26SIRegisterGetHWRegNum.inc: SIGenRegisterInfo.pl 27 $(PERL) $^ $@ > /dev/null 28 29R600Intrinsics.td: R600IntrinsicsNoOpenCL.td R600IntrinsicsOpenCL.td 30ifeq ($(HAVE_LLVM_INTRINSICS),) 31 cp R600IntrinsicsNoOpenCL.td R600Intrinsics.td 32else 33 cp R600IntrinsicsOpenCL.td R600Intrinsics.td 34endif 35 36R600RegisterInfo.td: R600GenRegisterInfo.pl 37 $(PERL) $^ > $@ 38 39AMDGPUGenRegisterInfo.inc: $(TD_FILES) 40 $(call tablegen, -gen-register-info, AMDGPU.td, $@) 41 42AMDGPUGenInstrInfo.inc: $(TD_FILES) 43 $(call tablegen, -gen-instr-info, AMDGPU.td, $@) 44 45AMDGPUGenAsmWriter.inc: $(TD_FILES) 46 $(call tablegen, -gen-asm-writer, AMDGPU.td, $@) 47 48AMDGPUGenDAGISel.inc: $(TD_FILES) 49 $(call tablegen, -gen-dag-isel, AMDGPU.td, $@) 50 51AMDGPUGenCallingConv.inc: $(TD_FILES) 52 $(call tablegen, -gen-callingconv, AMDGPU.td, $@) 53 54AMDGPUGenSubtargetInfo.inc: $(TD_FILES) 55 $(call tablegen, -gen-subtarget, AMDGPU.td, $@) 56 57AMDGPUGenEDInfo.inc: $(TD_FILES) 58 $(call tablegen, -gen-enhanced-disassembly-info, AMDGPU.td, $@) 59 60AMDGPUGenIntrinsics.inc: $(TD_FILES) 61 $(call tablegen, -gen-tgt-intrinsic, AMDGPU.td, $@) 62 63AMDGPUGenCodeEmitter.inc: $(TD_FILES) 64 $(call tablegen, -gen-emitter, AMDGPU.td, $@) 65 66AMDGPUGenMCCodeEmitter.inc: $(TD_FILES) 67 $(call tablegen, -mc-emitter -gen-emitter, AMDGPU.td, $@) 68 69AMDGPUGenDFAPacketizer.inc: $(TD_FILES) 70 $(call tablegen, -gen-dfa-packetizer, AMDGPU.td, $@) 71 72LOADER_LIBS=$(shell llvm-config --libs bitreader asmparser) 73loader: loader.o libradeon.a 74 gcc -o loader $(LLVM_LDFLAGS) -L/usr/local/lib $(LDFLAGS) loader.o libradeon.a $(LLVM_LIBS) $(LOADER_LIBS) -lpthread -ldl -lstdc++ -lm 75