tablegen = $(TBLGEN) -I $(LLVM_INCLUDEDIR) $1 $2 -o $3
+HAVE_LLVM_INTRINSICS = $(shell grep IntrinsicsR600.td $(LLVM_INCLUDEDIR)/llvm/Intrinsics.td)
+
gen: $(GENERATED_SOURCES)
SIRegisterInfo.td: SIGenRegisterInfo.pl
SIRegisterGetHWRegNum.inc: SIGenRegisterInfo.pl
$(PERL) $^ $@ > /dev/null
-R600ShaderPatterns.td: AMDGPUGenShaderPatterns.pl
- $(PERL) $^ C > $@
-
+R600Intrinsics.td: R600IntrinsicsNoOpenCL.td R600IntrinsicsOpenCL.td
+ifeq ($(HAVE_LLVM_INTRINSICS),)
+ cp R600IntrinsicsNoOpenCL.td R600Intrinsics.td
+else
+ cp R600IntrinsicsOpenCL.td R600Intrinsics.td
+endif
+
R600RegisterInfo.td: R600GenRegisterInfo.pl
$(PERL) $^ > $@
-AMDGPUInstrEnums.td: AMDGPUGenInstrEnums.pl
- $(PERL) $^ td > $@
-
-AMDGPUInstrEnums.h.include: AMDGPUGenInstrEnums.pl
- $(PERL) $^ h > $@
+AMDGPUGenRegisterInfo.inc: *.td
+ $(call tablegen, -gen-register-info, AMDGPU.td, $@)
-AMDGPUInstrEnums.include: AMDGPUGenInstrEnums.pl
- $(PERL) $^ inc > $@
+AMDGPUGenInstrInfo.inc: *.td
+ $(call tablegen, -gen-instr-info, AMDGPU.td, $@)
+AMDGPUGenAsmWriter.inc: *.td
+ $(call tablegen, -gen-asm-writer, AMDGPU.td, $@)
-AMDILGenRegisterInfo.inc: *.td
- $(call tablegen, -gen-register-info, AMDIL.td, $@)
+AMDGPUGenDAGISel.inc: *.td
+ $(call tablegen, -gen-dag-isel, AMDGPU.td, $@)
-AMDILGenInstrInfo.inc: *.td
- $(call tablegen, -gen-instr-info, AMDIL.td, $@)
+AMDGPUGenCallingConv.inc: *.td
+ $(call tablegen, -gen-callingconv, AMDGPU.td, $@)
-AMDILGenAsmWriter.inc: *.td
- $(call tablegen, -gen-asm-writer, AMDIL.td, $@)
+AMDGPUGenSubtargetInfo.inc: *.td
+ $(call tablegen, -gen-subtarget, AMDGPU.td, $@)
-AMDILGenDAGISel.inc: *.td
- $(call tablegen, -gen-dag-isel, AMDIL.td, $@)
+AMDGPUGenEDInfo.inc: *.td
+ $(call tablegen, -gen-enhanced-disassembly-info, AMDGPU.td, $@)
-AMDILGenCallingConv.inc: *.td
- $(call tablegen, -gen-callingconv, AMDIL.td, $@)
+AMDGPUGenIntrinsics.inc: *.td
+ $(call tablegen, -gen-tgt-intrinsic, AMDGPU.td, $@)
-AMDILGenSubtargetInfo.inc: *.td
- $(call tablegen, -gen-subtarget, AMDIL.td, $@)
+AMDGPUGenCodeEmitter.inc: *.td
+ $(call tablegen, -gen-emitter, AMDGPU.td, $@)
-AMDILGenEDInfo.inc: *.td
- $(call tablegen, -gen-enhanced-disassembly-info, AMDIL.td, $@)
-
-AMDILGenIntrinsics.inc: *.td
- $(call tablegen, -gen-tgt-intrinsic, AMDIL.td, $@)
-
-AMDILGenCodeEmitter.inc: *.td
- $(call tablegen, -gen-emitter, AMDIL.td, $@)
+AMDGPUGenDFAPacketizer.inc: *.td
+ $(call tablegen, -gen-dfa-packetizer, AMDGPU.td, $@)
LOADER_LIBS=$(shell llvm-config --libs bitreader asmparser)
loader: loader.o libradeon.a
gcc -o loader -L/usr/local/lib $(LDFLAGS) loader.o libradeon.a $(LLVM_LIBS) $(LOADER_LIBS) -lpthread -ldl -lstdc++ -lm
-
-# FIXME: Remove when this driver is converted to automake.
-all: default