xref: /freebsd/sys/modules/aic7xxx/ahc/Makefile (revision a2f733abcff64628b7771a47089628b7327a88bd)
1
2SYSDIR?=${SRCTOP}/sys
3.include "${SYSDIR}/conf/kern.opts.mk"
4
5.PATH:	${SYSDIR}/dev/aic7xxx
6KMOD=	ahc
7SUBDIR+= ahc_isa ahc_pci
8
9GENSRCS= aic7xxx_seq.h aic7xxx_reg.h
10# AHC_REG_PRETTY_PRINT=1
11REG_PRINT_OPT=
12.ifdef AHC_REG_PRETTY_PRINT
13GENSRCS+= aic7xxx_reg_print.c
14CFLAGS+= -DAHC_REG_PRETTY_PRINT=1
15REG_PRINT_OPT= -p aic7xxx_reg_print.c
16.endif
17BEFORE_DEPEND = ${GENSRCS}
18
19../aicasm/aicasm: ${SYSDIR}/dev/aic7xxx/aicasm/*.[chyl]
20	( cd ${.CURDIR}/../aicasm; ${MAKE} aicasm; )
21
22.if make(ahcfirmware)
23ahcfirmware: ${GENSRCS}
24${GENSRCS}:								 \
25		${SYSDIR}/dev/aic7xxx/aic7xxx.{reg,seq}	 \
26		${SYSDIR}/cam/scsi/scsi_message.h
27	../aicasm/aicasm ${INCLUDES} -I${SYSDIR}/cam/scsi	 \
28			-I${SYSDIR}/dev/aic7xxx		 \
29			-o aic7xxx_seq.h -r aic7xxx_reg.h		 \
30			${REG_PRINT_OPT}				 \
31			-i ${SYSDIR}/dev/aic7xxx/aic7xxx_osm.h \
32			${SYSDIR}/dev/aic7xxx/aic7xxx.seq
33.elif defined(.MAKE.LEVEL)
34# This target interfers with fmake's world view and causes this message
35# to appear when building the tree from 8.x worlds where fmake is the
36# default. fmake doens't define .MAKE.LEVEL so key off that to omit it,
37# while still allowing more-modern makes to theoretically update things.
38${GENSRCS}: .NOMETA
39	@echo "Error: ${.TARGET} is missing.  Run 'make ahcfirmware'"
40.endif
41
42
43SRCS= ${GENSRCS}
44SRCS+= aic7xxx.c aic7xxx_93cx6.c aic7xxx_osm.c aic7770.c
45SRCS+= opt_scsi.h opt_aic7xxx.h opt_cam.h
46SRCS+= device_if.h bus_if.h pci_if.h
47
48.if make(cleanfirmware)
49cleanfirmware: clean
50CLEANFILES= ${GENSRCS}
51.endif
52
53EXPORT_SYMS=	YES
54
55.include <bsd.kmod.mk>
56