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