summaryrefslogtreecommitdiff
path: root/gcc/Makefile
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-04-30 04:57:33 -0700
committerYamaArashi <shadow962@live.com>2016-04-30 04:57:33 -0700
commitd1cb3194bb20a44eecafe4186cf4e368f2a4d5b8 (patch)
treed0f27aa47b8f124d7e92b2e2747cc8c05da676b0 /gcc/Makefile
parent0dfd357a5116b3d76fbaa9bcdd16902c28f60d2b (diff)
build libgcc with older version of compiler and add install script
Diffstat (limited to 'gcc/Makefile')
-rw-r--r--gcc/Makefile20
1 files changed, 14 insertions, 6 deletions
diff --git a/gcc/Makefile b/gcc/Makefile
index 358b1de..eb6d667 100644
--- a/gcc/Makefile
+++ b/gcc/Makefile
@@ -24,7 +24,7 @@ VPATH = $(srcdir)
CC = gcc
-CFLAGS = -g -std=gnu11 -Wunused-function -m32
+BASE_CFLAGS = -g -std=gnu11 -Wunused-function -m32
INCLUDES = -I. -I$(srcdir)
@@ -55,8 +55,17 @@ GENERATED = genrtl.c genrtl.h \
tree-check.h \
insn-config.h insn-flags.h insn-codes.h insn-attr.h
-agbcc: $(OBJS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(RTL_OBJS) $(PRINT_OBJS) $(RTLANAL_OBJS)
+.PHONY: normal old clean
+
+# The usual compiler.
+normal: CFLAGS = $(BASE_CFLAGS)
+normal: $(OBJS)
+ $(CC) $(CFLAGS) -o agbcc $(OBJS) $(RTL_OBJS) $(PRINT_OBJS) $(RTLANAL_OBJS)
+
+# The old version of the compiler, used for building libgcc.
+old: CFLAGS = $(BASE_CFLAGS) -DOLD_COMPILER
+old: $(OBJS)
+ $(CC) $(CFLAGS) -o old_agbcc $(OBJS) $(RTL_OBJS) $(PRINT_OBJS) $(RTLANAL_OBJS)
# Clear suffixes.
.SUFFIXES:
@@ -84,10 +93,9 @@ $(DEPDIR)/%.d: ;
GEN = genemit genoutput genrecog genextract genflags gencodes genconfig \
genpeep gengenrtl gencheck genattr genattrtab genopinit
-.PHONY: clean
-
clean:
- $(RM) agbcc agbcc.exe $(OBJS) $(RTL_OBJS) $(RTLANAL_OBJS) $(PRINT_OBJS)
+ $(RM) agbcc agbcc.exe old_agbcc old_agbcc.exe
+ $(RM) $(OBJS) $(RTL_OBJS) $(RTLANAL_OBJS) $(PRINT_OBJS)
$(RM) $(GENERATED)
$(RM) $(GEN) $(addsuffix .exe,$(GEN)) $(addsuffix .o,$(GEN))
$(RM) s-config s-flags s-codes s-emit s-recog s-opinit s-extract s-peep \