2 ##------------------------------------------------------------------------
3 ## Common rules for generating, linking, and compiling via LLVM.
4 ##------------------------------------------------------------------------
9 TOOLS = $(LEVEL)/tools/Debug
18 LCC = /home/vadve/lattner/cvs/gcc_install/bin/gcc
19 LCFLAGS = -O2 $(LOCAL_CFLAGS) -Wall
21 LLCLIB = $(LEVEL)/test/runtime.o
22 LIBS = $(LLCLIB) $(LOCAL_LIBS)
25 LLCFLAGS := $(LLCFLAGS) -trace
28 CC = /opt/SUNWspro/bin/cc
29 AS = /opt/SUNWspro/bin/cc
30 DIS = /usr/ccs/bin/dis
34 ASFLAGS = -c $(CFLAGS)
36 ## Special targets to build a program from multiple source files
40 default: $(PROG).clean.bc $(PROG).native
41 #.SECONDARY: $(PROG).clean.bc ## keep %.clean.bc from being deleted
44 $(LLINK) -f $(OBJS) -o $@
46 $(PROG).native: $(OBJS:.o=.c)
47 gcc -o $@ $(OBJS:.o=.c) -O2 $(LOCAL_CFLAGS) -Wall
50 ## Special target to force target-dependent library to be compiled
51 ## directly to native code.
54 cd $(LEVEL)/test; $(MAKE) $(@F)
57 $(CC) -c $(CCFLAGS) $<
60 rm -f *.[123] *.bc *.mc *.s *.o a.out core $(PROG)
62 %.mc: %.bc $(LLC) $(AS)
63 @echo "Generating machine instructions for $<"
64 $(LLC) -f -dsched y $(LLCFLAGS) $< > $@
66 %.trace.bc: %.bc $(LLC)
67 $(LLC) -f -trace $(LLCFLAGS) $<
70 $(LCC) $(LCFLAGS) -c -o $@ $<
76 $(LOPT) -cleangcc -raise -constprop -dce < $< > $@
79 $(LLC) -f $(LLCOPTS) $<
82 $(CC) -o $@ $(LDFLAGS) $< $(LIBS)
85 ## Use a single rule to go from %.bc to % to avoid ambiguity in
86 ## llvm bytecode files and native object code files, both named %.o
89 $(LLC) -f $(LLCFLAGS) -o $*.s $<
91 $(CC) -o $@ $(LDFLAGS) $*.o $(LIBS)
93 ## Cancel built-in implicit rule that overrides the above rule
96 ## The next two rules are for disassembling an executable or an object file