mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Move some makefile stuff to subdirectories
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1543 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fca0402b2b
commit
c89764e80c
@ -1,6 +1,6 @@
|
|||||||
## -*-Makefile-*-
|
##-----------------------------------------------------------*-Makefile-*-
|
||||||
##------------------------------------------------------------------------
|
## Common rules for generating, linking, and compiling via LLVM. This is
|
||||||
## Common rules for generating, linking, and compiling via LLVM.
|
## used to implement a robust testing framework for LLVM
|
||||||
##------------------------------------------------------------------------
|
##------------------------------------------------------------------------
|
||||||
|
|
||||||
## NOTE: This is preliminary and will change in the future
|
## NOTE: This is preliminary and will change in the future
|
||||||
@ -10,8 +10,8 @@ include ${LEVEL}/Makefile.common
|
|||||||
|
|
||||||
.PHONY: clean default
|
.PHONY: clean default
|
||||||
|
|
||||||
## keep %.linked.bc and %.s from being deleted while we're debugging
|
## keep %.bc and %.s from being deleted while we're debugging
|
||||||
.PRECIOUS: %.bc %.s %.ll
|
.PRECIOUS: Output/%.bc Output/%.ll %.s Output/.dir
|
||||||
|
|
||||||
|
|
||||||
TOOLS = $(LEVEL)/tools/Debug
|
TOOLS = $(LEVEL)/tools/Debug
|
||||||
@ -25,16 +25,16 @@ LLINK = $(TOOLS)/link
|
|||||||
LLCFLAGS =
|
LLCFLAGS =
|
||||||
|
|
||||||
LCC = /home/vadve/lattner/cvs/gcc_install/bin/gcc
|
LCC = /home/vadve/lattner/cvs/gcc_install/bin/gcc
|
||||||
LCFLAGS = -O2 $(LOCAL_LCFLAGS) -Wall
|
LCFLAGS += -O2 -Wall
|
||||||
|
|
||||||
LLCLIB = $(LEVEL)/test/runtime.o
|
LLCLIB = $(LEVEL)/test/runtime.o
|
||||||
LIBS = $(LLCLIB) $(LOCAL_LIBS)
|
LIBS += $(LLCLIB)
|
||||||
|
|
||||||
ifeq ($(TRACE), yes)
|
ifeq ($(TRACE), yes)
|
||||||
LLCFLAGS := $(LLCFLAGS) -trace
|
LLCFLAGS += -trace
|
||||||
endif
|
endif
|
||||||
ifeq ($(TRACEM), yes)
|
ifeq ($(TRACEM), yes)
|
||||||
LLCFLAGS := $(LLCFLAGS) -tracem
|
LLCFLAGS += -tracem
|
||||||
endif
|
endif
|
||||||
|
|
||||||
NATGCC = /usr/dcs/software/supported/bin/gcc
|
NATGCC = /usr/dcs/software/supported/bin/gcc
|
||||||
@ -42,32 +42,8 @@ NATGCC = /usr/dcs/software/supported/bin/gcc
|
|||||||
CC = /opt/SUNWspro/bin/cc
|
CC = /opt/SUNWspro/bin/cc
|
||||||
AS = /opt/SUNWspro/bin/cc
|
AS = /opt/SUNWspro/bin/cc
|
||||||
DIS = /usr/ccs/bin/dis
|
DIS = /usr/ccs/bin/dis
|
||||||
CP = /bin/cp -p
|
CP = /bin/cp -f
|
||||||
CFLAGS = -g -xarch=v9 $(LOCAL_CFLAGS)
|
CFLAGS += -g -xarch=v9
|
||||||
CCFLAGS = $(CFLAGS)
|
|
||||||
LDFLAGS = $(CFLAGS) $(LOCAL_LDFLAGS)
|
|
||||||
ASFLAGS = -c $(CFLAGS)
|
|
||||||
|
|
||||||
## Special targets to build a program from multiple source files
|
|
||||||
##
|
|
||||||
ifdef PROG
|
|
||||||
|
|
||||||
default: $(PROG) $(PROG).native
|
|
||||||
|
|
||||||
ifeq ($(strip $(OBJS)),)
|
|
||||||
BCOBJS = $(PROG).bc
|
|
||||||
else
|
|
||||||
BCOBJS = $(OBJS:.o=.bc)
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(PROG).linked.bc: $(BCOBJS)
|
|
||||||
$(LLINK) -f $(BCOBJS) -o $(PROG).tmp.bc
|
|
||||||
$(LOPT) -cleangcc -raise -constprop -dce $(PROG).tmp.bc -o $@ -f
|
|
||||||
$(RM) $(PROG).tmp.bc
|
|
||||||
|
|
||||||
$(PROG).native: $(OBJS:.o=.c)
|
|
||||||
$(CC) $(OBJS:.o=.c) -g $(LOCAL_LCFLAGS) $(CFLAGS) -lm -o $@
|
|
||||||
endif
|
|
||||||
|
|
||||||
## Special target to force target-dependent library to be compiled
|
## Special target to force target-dependent library to be compiled
|
||||||
## directly to native code.
|
## directly to native code.
|
||||||
@ -75,11 +51,12 @@ endif
|
|||||||
$(LLCLIB): $(LLCLIB:.o=.c)
|
$(LLCLIB): $(LLCLIB:.o=.c)
|
||||||
cd $(LEVEL)/test; $(MAKE) $(@F)
|
cd $(LEVEL)/test; $(MAKE) $(@F)
|
||||||
|
|
||||||
runtime.o: runtime.c
|
#runtime.o: runtime.c
|
||||||
$(CC) -c $(CCFLAGS) $<
|
# $(CC) -c $(CCFLAGS) $<
|
||||||
|
|
||||||
clean ::
|
clean ::
|
||||||
$(RM) *.bc *.mc *.s *.o a.out core $(PROG) $(PROG).native
|
$(RM) *.bc *.mc *.s *.o a.out core
|
||||||
|
$(RM) -rf Output/
|
||||||
|
|
||||||
%.mc: %.bc $(LLC) $(AS)
|
%.mc: %.bc $(LLC) $(AS)
|
||||||
@echo "Generating machine instructions for $<"
|
@echo "Generating machine instructions for $<"
|
||||||
@ -90,23 +67,20 @@ clean ::
|
|||||||
|
|
||||||
|
|
||||||
## FIXME: LIBS should be specified, not hardcoded to -lm
|
## FIXME: LIBS should be specified, not hardcoded to -lm
|
||||||
%.native: %.c
|
#Output/%.native: %.c Output/.dir
|
||||||
$(NATGCC) $+ -lm -o $@
|
# $(NATGCC) $+ -lm -o $@
|
||||||
|
|
||||||
%.ll: %.c $(LCC)
|
Output/%.ll: %.c $(LCC) Output/.dir
|
||||||
$(LCC) $(LCFLAGS) -S $< -o $@
|
$(LCC) $(LCFLAGS) -S $< -o $@
|
||||||
|
|
||||||
%.bc: %.ll $(LAS)
|
%.bc: %.ll $(LAS)
|
||||||
$(LAS) $< -o $@
|
$(LAS) $< -o $@
|
||||||
|
|
||||||
%.linked.bc: %.bc
|
#%.s: %.linked.bc
|
||||||
$(CP) $< $@
|
# $(LLC) -f $(LCFLAGS) $< -o $@
|
||||||
|
|
||||||
%.s: %.linked.bc
|
#%: %.o $(LIBS)
|
||||||
$(LLC) -f $(LLCFLAGS) $< -o $@
|
# $(CC) $(LDFLAGS) $< $(LIBS) -o $@
|
||||||
|
|
||||||
%: %.o $(LIBS)
|
|
||||||
$(CC) $(LDFLAGS) $< $(LIBS) -o $@
|
|
||||||
|
|
||||||
|
|
||||||
## Cancel built-in implicit rules that override above rules
|
## Cancel built-in implicit rules that override above rules
|
||||||
|
Loading…
Reference in New Issue
Block a user