Remove makefile complexity by always running tablegen with its final output
[oota-llvm.git] / lib / Target / SparcV9 / Makefile
1 LEVEL = ../../..
2 LIBRARYNAME = sparc
3
4 ExtraSource = Debug/Sparc.burm.cpp 
5
6 include $(LEVEL)/Makefile.common
7
8 ifdef ENABLE_OPTIMIZED
9   DEBUG_FLAG = 
10 else
11   DEBUG_FLAG = -D_DEBUG
12 endif
13
14 Debug/Sparc.burm.cpp: Debug/Sparc.burm Debug/.dir
15         $(RunBurg) $< -o $@
16
17 $(BUILD_OBJ_DIR)/Debug/Sparc.burm.lo: Debug/Sparc.burm.cpp
18         $(CompileG) $< -o $@
19
20 $(BUILD_OBJ_DIR)/Release/Sparc.burm.lo: Debug/Sparc.burm.cpp
21         $(CompileO) $< -o $@
22
23 $(BUILD_OBJ_DIR)/Profile/Sparc.burm.lo: Debug/Sparc.burm.cpp
24         $(CompileP) $< -o $@
25
26 #$(BUILD_OBJ_DIR)/Debug/Sparc.burm.o: Debug/Sparc.burm.cpp
27 #       $(CompileG) $< -o $@
28
29 #$(BUILD_OBJ_DIR)/Release/Sparc.burm.o: Debug/Sparc.burm.cpp
30 #       $(CompileO) $< -o $@
31
32 #$(BUILD_OBJ_DIR)/Profile/Sparc.burm.o: Debug/Sparc.burm.cpp
33 #       $(CompileP) $< -o $@
34
35 Debug/Sparc.burg.in1 : Sparc.burg.in Debug/.dir
36         $(CXX) -E -I$(LEVEL)/include $(DEBUG_FLAG) -x c++ $< | ${SED} '/^# /d' | ${SED} 's/Ydefine/#define/' > $@
37
38 Debug/Sparc.burm : Debug/Sparc.burg.in1
39         $(CXX) -E -I$(LEVEL)/include $(DEBUG_FLAG) -x c++ $< | ${SED} '/^# /d' | ${SED} 's/Xinclude/#include/g' | ${SED} 's/Xdefine/#define/g' > $@
40
41 $(BUILD_OBJ_DIR)/Depend/Sparc.burm.d: $(BUILD_OBJ_DIR)/Depend/.dir
42         touch $@
43
44 SparcV9CodeEmitter.cpp: SparcV9CodeEmitter.inc
45
46
47 TARGET_NAME := SparcV9
48
49 TABLEGEN_FILES := $(wildcard *.td)
50
51 $(TARGET_NAME)CodeEmitter.inc: $(TABLEGEN_FILES) $(TBLGEN)
52         $(TBLGEN) $(TARGET_NAME).td -gen-emitter -o $@
53
54 clean::
55         ${RM} -f $(TARGET_NAME)CodeEmitter.inc