view Makefile @ 160:1f440a2790fb

*** empty log message ***
author kono
date Sun, 23 Nov 2003 19:54:02 +0900
parents 7bc02f0800a9
children cc2fc5c0dfe5
line wrap: on
line source

CC = gcc 
# -O3
CFLAGS = -g -Wall -I.
BASE=0
STAGE=1
MFLAGS=$(MFALGS) BASE=$(BASE) STAGE=$(STAGE)
ARCH=powerpc
MC=mc-$(ARCH)
# MLIB = -lm
PRINTF= # printf.c
CONVERTER=conv/c.o conv/null.o
# conv/c2cbc.o conv/cbc2c.o
COMPLIB = mc-parse.o mc-codegen.o mc-tree.o
# CODE=mc-code-ia32.c
CODE=mc-code-$(ARCH).c

all: mc mc-ia32 mc-powerpc mc-mips

mc:  mc-$(ARCH)
	cp mc-$(ARCH) mc

mc-powerpc : mc-code-powerpc.o $(COMPLIB) $(CONVERTER)
	$(CC) -g mc-code-powerpc.o $(COMPLIB) $(CONVERTER) -o $@

mc-ia32 : mc-code-ia32.o $(COMPLIB) $(CONVERTER)
	$(CC) -g mc-code-ia32.o $(COMPLIB) $(CONVERTER) -o $@

mc-mips : mc-code-mips.o $(COMPLIB) $(CONVERTER)
	$(CC) -g mc-code-mips.o $(COMPLIB) $(CONVERTER) -o $@

conv/conv.h: conv_func.tbl conv_func.pl
	perl conv_func.pl
conv/convdef.h: conv_func.tbl conv_func.pl
	perl conv_func.pl
conv/null.c: conv_func.tbl conv_func.pl
	perl conv_func.pl

check-all:
	make check TARGET=test/basic
	make check TARGET=test/call
	make check TARGET=test/fact0
	make check TARGET=test/float
	make check TARGET=test/ifdef
	make check TARGET=test/int
	make check TARGET=test/macro
	make check TARGET=test/regargs
	make check TARGET=test/simp
	make check TARGET=test/simp0
	make check TARGET=test/tmp
	make check TARGET=test/tmp10
	make check TARGET=test/tmp11
	make check TARGET=test/tmp7
	make check TARGET=test/tmp8
	make check TARGET=test/tmp9
	make check TARGET=test/static

check: $(MC)
	-gcc $(TARGET).c -o b.out $(MLIB)
	-./b.out > $(TARGET).gcc.out
	-./$(MC) -s $(TARGET).c
	-gcc $(TARGET).s $(MLIB)
	-./a.out > $(TARGET).$(MC).out
	-diff  $(TARGET).gcc.out $(TARGET).$(MC).out

tar :
	make clean
	tar cBf - . | gzip > ../comp.tgz 

depend :
	makedepend mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \
		mc-parse.c mc-tree.c mc.h \
	    conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \
	    conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \
                mc-code-powerpc.c \
                mc-code-mips.c

clean :
	-rm -f mc mc-ia32 mc-powerpc mc-mips *.bak *.s *.o *.cc mc mc1 mc2 a.out *~ core* */*.o *.bak test/*.s test/*.cc test/*.o test/*.bak test/*~ conv/*.s conv/*.cc conv/*.o conv/*.bak conv/*~ *.out */*.out *.i */*.i

mc1 : b00.s b01.s mc-codegen.o mc-tree.o $(CONVERTER)
	$(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o $(CONVERTER)

mc2 : b00.s b01.s b02.s b03.s mc-codegen.o mc-tree.o $(CONVERTER)
	$(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s $(CONVERTER)

b00.s : mc-parse.c $(MC)
	./$(MC) -s -ob00.s mc-parse.c
b01.s : $(CODE) $(MC)
	./$(MC) -s -ob01.s $(CODE)
b02.s : mc-codegen.c $(MC)
	./$(MC) -s -ob02.s mc-codegen.c
b03.s : mc-tree.c $(MC)
	./$(MC) -s -ob03.s mc-tree.c

b10.s : mc-parse.c mc1
	./mc1 -s -ob10.s mc-parse.c
b11.s : $(CODE) $(PRINTF) mc1
	./mc1 -s -ob11.s $(CODE)
b12.s : mc-codegen.c mc1
	./mc1 -s -ob12.s mc-codegen.c
b13.s : mc-tree.c mc1
	./mc1 -s -ob13.s mc-tree.c

b20.s : mc-parse.c mc2
	./mc2 -s -ob20.s mc-parse.c
b21.s : $(CODE) $(PRINTF) mc2
	./mc2 -s -ob21.s $(CODE)
b22.s : mc-codegen.c mc2
	./mc2 -s -ob22.s mc-codegen.c
b23.s : mc-tree.c mc2
	./mc2 -s -ob23.s mc-tree.c

diff :  b00.s b01.s b02.s b03.s b10.s b11.s b12.s b13.s
	-diff b00.s b10.s
	-diff b01.s b11.s
	-diff b02.s b12.s
	-diff b03.s b13.s

diff2 :  b00.s b01.s b02.s b03.s b20.s b21.s b22.s b23.s
	-diff b00.s b20.s
	-diff b01.s b21.s
	-diff b02.s b22.s
	-diff b03.s b23.s


# DO NOT DELETE

mc-code-ia32.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
mc-code-ia32.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
mc-code-ia32.o: /usr/include/machine/types.h /usr/include/ppc/types.h
mc-code-ia32.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
mc-code-ia32.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
mc-code-ia32.o: conv/conv.h mc-codegen.h mc-code.h
mc-codegen.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
mc-codegen.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
mc-codegen.o: /usr/include/machine/types.h /usr/include/ppc/types.h
mc-codegen.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
mc-codegen.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
mc-codegen.o: conv/conv.h mc-codegen.h mc-code.h
mc-parse.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
mc-parse.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
mc-parse.o: /usr/include/machine/types.h /usr/include/ppc/types.h
mc-parse.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
mc-parse.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
mc-parse.o: conv/conv.h mc-codegen.h
mc-tree.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
mc-tree.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
mc-tree.o: /usr/include/machine/types.h /usr/include/ppc/types.h
mc-tree.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
mc-tree.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
mc-tree.o: conv/conv.h
mc.o: /usr/include/stdio.h /usr/include/sys/types.h
mc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
mc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
mc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
mc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h conv/conv.h
conv/c.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
conv/c.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
conv/c.o: /usr/include/machine/types.h /usr/include/ppc/types.h
conv/c.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
conv/c.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h conv/conv.h
conv/c.o: conv/convdef.h conv/c.h
conv/c2cbc.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
conv/c2cbc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
conv/c2cbc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
conv/c2cbc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
conv/c2cbc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
conv/c2cbc.o: conv/conv.h
conv/cbc2c.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
conv/cbc2c.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
conv/cbc2c.o: /usr/include/machine/types.h /usr/include/ppc/types.h
conv/cbc2c.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
conv/cbc2c.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
conv/cbc2c.o: conv/conv.h
conv/null.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
conv/null.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
conv/null.o: /usr/include/machine/types.h /usr/include/ppc/types.h
conv/null.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
conv/null.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
conv/null.o: conv/conv.h conv/convdef.h conv/null.h
mc-code-powerpc.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
mc-code-powerpc.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
mc-code-powerpc.o: /usr/include/machine/types.h /usr/include/ppc/types.h
mc-code-powerpc.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
mc-code-powerpc.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
mc-code-powerpc.o: conv/conv.h mc-code.h mc-codegen.h
mc-code-mips.o: mc.h /usr/include/stdio.h /usr/include/sys/types.h
mc-code-mips.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
mc-code-mips.o: /usr/include/machine/types.h /usr/include/ppc/types.h
mc-code-mips.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
mc-code-mips.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
mc-code-mips.o: conv/conv.h mc-code.h mc-codegen.h