xref: /netbsd/external/bsd/pcc/dist/pcc/f77/fcom/Makefile.in (revision 6550d01e)
1#	Id: Makefile.in,v 1.13 2008/12/19 08:08:48 ragge Exp
2#	$NetBSD: Makefile.in,v 1.1.1.3 2010/06/03 18:57:45 plunky Exp $
3#
4# Makefile for the Fortran 77 command
5#  Running on the @targmach@
6#  Generating code for the @targmach@
7#  Using the Johnson C compiler's second pass (binary version)
8VPATH=@srcdir@
9srcdir=@srcdir@
10top_srcdir=@top_srcdir@
11builddir=@builddir@
12top_builddir=@top_builddir@
13XFL=-DPCC_DEBUG  -Wall -Wmissing-prototypes -Wstrict-prototypes -Werror \
14	-Werror -Wshadow -Wsign-compare
15
16CC = @CC@
17CC_FOR_BUILD = @CC_FOR_BUILD@
18CFLAGS = @CFLAGS@ @ADD_CFLAGS@
19CPPFLAGS = @CPPFLAGS@ ${XFL} -DFCOM -DLANG_F77 -Dos_${TARGOS} \
20	-I${srcdir} -I${builddir} -I${top_builddir} \
21	-I${MIPDIR} -I${MDIR} -Dmach_${TARGMACH} -I${top_srcdir}/os/${TARGOS}
22LIBS = @LIBS@
23LDFLAGS = @LDFLAGS@
24TARGOS = @targos@
25TARGMACH = @targmach@
26prefix = @prefix@
27exec_prefix = @exec_prefix@
28libexecdir = @libexecdir@
29datarootdir = @datarootdir@
30mandir = @mandir@
31strip = @strip@
32INSTALL = @INSTALL@
33INSTALL_PROGRAM = @INSTALL_PROGRAM@
34YFLAGS = -d
35
36MDIR=$(top_srcdir)/arch/$(TARGMACH)
37MIPDIR=$(top_srcdir)/mip
38
39DEST=@BINPREFIX@fcom
40
41OBJS1 = main.o init.o proc.o gram.o lex.o \
42	  equiv.o data.o expr.o exec.o intr.o io.o misc.o error.o\
43	  put.o putscj.o flocal.o
44
45OBJS2=match.o reader.o optim2.o regs.o local2.o order.o table.o
46
47OBJS=$(OBJS1) $(OBJS2) common.o external.o
48
49all: ${DEST}
50
51${DEST}: $(OBJS)
52	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
53
54gram.c:	gram.head gram.dcl gram.expr gram.exec gram.io tokdefs
55	( sed <tokdefs "s/#define/%token/" ;\
56		cat gram.head gram.dcl gram.expr gram.exec gram.io ) >gram.in
57	$(YACC) $(YFLAGS) gram.in
58	mv y.tab.c gram.c
59	mv y.tab.h gram.h
60	rm gram.in
61
62tokdefs: tokens
63	grep -n . <tokens | sed "s/\([^:]*\):\(.*\)/#define \2 \1/" >tokdefs
64
65lex.o : tokdefs
66driver.o $(OBJS)  : defs.h defines.h ftypes.h
67
68clean:
69	/bin/rm -f $(OBJS) ${DEST} gram.in gram.[ch] tokdefs \
70		mkext external.[ch]
71
72distclean: clean
73	/bin/rm -f Makefile
74
75install:
76	${INSTALL_PROGRAM} ${DEST} ${libexecdir}
77	@if [ ${strip} = yes ]; then            \
78		strip ${libexecdir}/${DEST} ;       \
79		echo strip ${libexecdir}/${DEST} ;  \
80	fi
81
82.c.o :
83	$(CC) -c $(CFLAGS) $(CPPFLAGS) $*.c
84
85flocal.o: $(MDIR)/flocal.c
86	$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $(MDIR)/flocal.c
87
88local2.o: $(MDIR)/local2.c
89	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(MDIR)/local2.c
90
91order.o: $(MDIR)/order.c
92	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(MDIR)/order.c
93
94table.o: $(MDIR)/table.c
95	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(MDIR)/table.c
96
97match.o: $(MIPDIR)/match.c
98	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(MIPDIR)/match.c
99
100reader.o: $(MIPDIR)/reader.c
101	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(MIPDIR)/reader.c
102
103optim2.o: $(MIPDIR)/optim2.c
104	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(MIPDIR)/optim2.c
105
106regs.o: $(MIPDIR)/regs.c
107	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(MIPDIR)/regs.c
108
109compat.o: $(MIPDIR)/compat.c
110	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(MIPDIR)/compat.c
111
112common.o: $(MIPDIR)/common.c
113	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(MIPDIR)/common.c
114
115external.h external.c: ${MIPDIR}/mkext.c $(MDIR)/table.c
116	$(CC_FOR_BUILD) $(DEFS) $(CPPFLAGS) $(CFLAGS) -DMKEXT -o mkext \
117	${MIPDIR}/mkext.c $(MDIR)/table.c ${MIPDIR}/common.c
118	./mkext
119	-rm -f mkext.o table.o common.o
120
121$(OBJS): external.h
122
123