Initial import from FreeBSD RELENG_4:
[dragonfly.git] / gnu / usr.bin / as / Makefile
1 #       from: @(#)Makefile      6.1 (Berkeley) 3/3/91
2 # $FreeBSD: src/gnu/usr.bin/as/Makefile,v 1.18.2.1 2001/04/25 12:03:26 ru Exp $
3
4 .include "config/Makefile.$(MACHINE_ARCH)"
5
6 .if !defined (gas_hosttype)
7 gas_hosttype=$(MACHINE_ARCH)
8 .endif
9 .if !defined (gas_target)
10 gas_target=$(MACHINE_ARCH)
11 .endif
12 .if !defined (gas_objformat)
13 gas_objformat=aout
14 .endif
15
16 ADDINCLUDE=-I${.OBJDIR}
17
18 PROG=           as
19 BINDIR= /usr/libexec/aout
20 MAN=            as.1aout
21 SRCS+=          app.c as.c atof-generic.c bignum-copy.c \
22                 cond.c expr.c flo-const.c flo-copy.c flonum-mult.c \
23                 frags.c hash.c hex-value.c input-file.c input-scrub.c \
24                 listing.c messages.c obstack.c output-file.c read.c subsegs.c \
25                 symbols.c version.c write.c xmalloc.c xrealloc.c \
26                 obj-$(gas_objformat).c ${CONF_HEADERS}
27 CFLAGS+=        -I$(.CURDIR) ${ADDINCLUDE} -I$(.CURDIR)/config \
28                 -DOLD_GAS -DSIGTY=void -Derror=as_fatal \
29                 -DSUB_SEGMENT_ALIGN=4 -DFREEBSD_AOUT
30
31 CONF_HEADERS=   targ-cpu.h obj-format.h host.h targ-env.h
32
33 .PATH: $(.CURDIR)/config
34
35 targ-cpu.h: Makefile config/Makefile.$(MACHINE_ARCH) $(.CURDIR)/config/tc-$(gas_target).h
36         @cmp -s $(.CURDIR)/config/tc-$(gas_target).h targ-cpu.h || \
37             ( ${ECHO} "updating ${.TARGET}..." ; /bin/rm -f targ-cpu.h ; \
38             cp $(.CURDIR)/config/tc-$(gas_target).h targ-cpu.h )
39
40 obj-format.h: Makefile config/Makefile.$(MACHINE_ARCH) $(.CURDIR)/config/obj-$(gas_objformat).h
41         @cmp -s $(.CURDIR)/config/obj-$(gas_objformat).h obj-format.h || \
42             ( ${ECHO} "updating ${.TARGET}..." ; /bin/rm -f obj-format.h ; \
43             cp $(.CURDIR)/config/obj-$(gas_objformat).h obj-format.h )
44
45 .if exists ($(.CURDIR)/config/ho-$(gas_hosttype).h)
46 config_hostfile=        $(.CURDIR)/config/ho-$(gas_hosttype).h
47 .else
48 config_hostfile=        $(.CURDIR)/config/ho-generic.h
49 .endif
50
51 host.h: Makefile config/Makefile.$(MACHINE_ARCH) $(config_hostfile)
52         @cmp -s $(config_hostfile) host.h || \
53             ( ${ECHO} "updating ${.TARGET}..." ; /bin/rm -f host.h ; \
54             cp $(config_hostfile) host.h )
55
56 .if exists ($(.CURDIR)/config/te-$(MACHINE_ARCH).h)
57 config_targenvfile=     $(.CURDIR)/config/te-$(MACHINE_ARCH).h
58 .else
59 config_targenvfile=     $(.CURDIR)/config/te-generic.h
60 .endif
61
62 targ-env.h: Makefile config/Makefile.$(MACHINE_ARCH) $(config_targenvfile)
63         @cmp -s $(config_targenvfile) targ-env.h || \
64             ( ${ECHO} "updating ${.TARGET}..." ; /bin/rm -f targ-env.h ; \
65             cp $(config_targenvfile) targ-env.h )
66
67 CLEANFILES+= ${CONF_HEADERS}
68
69 .include <bsd.prog.mk>