xref: /freebsd/sys/modules/aic7xxx/ahc/Makefile (revision e9ac41698b2f322d55ccf9da50a3596edb2c1800)
1193d9e76SEnji CooperSYSDIR?=${SRCTOP}/sys
2df3394b3SWarner Losh.include "${SYSDIR}/conf/kern.opts.mk"
377667fecSWarner Losh
4df3394b3SWarner Losh.PATH:	${SYSDIR}/dev/aic7xxx
50d74300cSScott LongKMOD=	ahc
677667fecSWarner LoshSUBDIR+= ahc_isa ahc_pci
70d74300cSScott Long
8201cef57SRuslan ErmilovGENSRCS= aic7xxx_seq.h aic7xxx_reg.h
9c15269ccSScott Long# AHC_REG_PRETTY_PRINT=1
10295ebaf8SJustin T. GibbsREG_PRINT_OPT=
11295ebaf8SJustin T. Gibbs.ifdef AHC_REG_PRETTY_PRINT
12295ebaf8SJustin T. GibbsGENSRCS+= aic7xxx_reg_print.c
13295ebaf8SJustin T. GibbsCFLAGS+= -DAHC_REG_PRETTY_PRINT=1
14295ebaf8SJustin T. GibbsREG_PRINT_OPT= -p aic7xxx_reg_print.c
15295ebaf8SJustin T. Gibbs.endif
16295ebaf8SJustin T. GibbsBEFORE_DEPEND = ${GENSRCS}
170d74300cSScott Long
18df3394b3SWarner Losh../aicasm/aicasm: ${SYSDIR}/dev/aic7xxx/aicasm/*.[chyl]
1950b464aaSScott Long	( cd ${.CURDIR}/../aicasm; ${MAKE} aicasm; )
2050b464aaSScott Long
2150b464aaSScott Long.if make(ahcfirmware)
2250b464aaSScott Longahcfirmware: ${GENSRCS}
23295ebaf8SJustin T. Gibbs${GENSRCS}:								 \
24df3394b3SWarner Losh		${SYSDIR}/dev/aic7xxx/aic7xxx.{reg,seq}	 \
25df3394b3SWarner Losh		${SYSDIR}/cam/scsi/scsi_message.h
26df3394b3SWarner Losh	../aicasm/aicasm ${INCLUDES} -I${SYSDIR}/cam/scsi	 \
27df3394b3SWarner Losh			-I${SYSDIR}/dev/aic7xxx		 \
2802b8bc80SJustin T. Gibbs			-o aic7xxx_seq.h -r aic7xxx_reg.h		 \
29295ebaf8SJustin T. Gibbs			${REG_PRINT_OPT}				 \
30*34db47a9SHP van Braam			-i "<dev/aic7xxx/aic7xxx_osm.h>" \
31df3394b3SWarner Losh			${SYSDIR}/dev/aic7xxx/aic7xxx.seq
32c8e00ff9SWarner Losh.elif defined(.MAKE.LEVEL)
33c8e00ff9SWarner Losh# This target interfers with fmake's world view and causes this message
34c8e00ff9SWarner Losh# to appear when building the tree from 8.x worlds where fmake is the
35c8e00ff9SWarner Losh# default. fmake doens't define .MAKE.LEVEL so key off that to omit it,
36c8e00ff9SWarner Losh# while still allowing more-modern makes to theoretically update things.
37e98bd750SBryan Drewery${GENSRCS}: .NOMETA
3850b464aaSScott Long	@echo "Error: ${.TARGET} is missing.  Run 'make ahcfirmware'"
3950b464aaSScott Long.endif
4050b464aaSScott Long
410d74300cSScott Long
420d74300cSScott LongSRCS= ${GENSRCS}
437afc0218SJustin T. GibbsSRCS+= aic7xxx.c aic7xxx_93cx6.c aic7xxx_osm.c aic7770.c
440d74300cSScott LongSRCS+= opt_scsi.h opt_aic7xxx.h opt_cam.h
450d74300cSScott LongSRCS+= device_if.h bus_if.h pci_if.h
460d74300cSScott Long
4750b464aaSScott Long.if make(cleanfirmware)
4850b464aaSScott Longcleanfirmware: clean
49295ebaf8SJustin T. GibbsCLEANFILES= ${GENSRCS}
5050b464aaSScott Long.endif
510d74300cSScott Long
525bb3134aSKonstantin BelousovEXPORT_SYMS=	YES
535bb3134aSKonstantin Belousov
540d74300cSScott Long.include <bsd.kmod.mk>
55