xref: /openbsd/sys/dev/microcode/aic7xxx/Makefile (revision 264ca280)
1# $OpenBSD: Makefile,v 1.11 2007/07/08 00:17:21 krw Exp $
2# $FreeBSD: src/sys/dev/aic7xxx/Makefile,v 1.6 1999/08/28 00:41:22 peter Exp $
3
4PROG=	aicasm
5
6CSRCS=	aicasm.c aicasm_symbol.c
7GENSRCS= aicasm_gram.c aicasm_scan.c aicasm_macro_gram.c aicasm_macro_scan.c
8
9GENHDRS=	aicasm_gram.h aicasm_macro_gram.h
10
11SRCS=	${GENSRCS} ${CSRCS}
12CLEANFILES+= ${GENSRCS} ${GENHDRS} y.output
13DPADD+=	${LIBL}
14LDADD+=	-ll
15CC=${HOSTCC}
16
17# Correct path for kernel builds
18# Don't rely on the kernel's .depend file
19.ifdef MAKESRCPATH
20.PATH: ${MAKESRCPATH}
21DEPENDFILE=
22.endif
23
24CFLAGS+= -I. -I${.CURDIR}
25YFLAGS= -d
26LFLAGS+= ${.TARGET:M*macro*:S/$(.TARGET)/-olex.yy.c/} ${.TARGET:M*macro*:S/$(.TARGET)/-Pmm/}
27NOMAN=	noman
28
29.ifdef DEBUG
30CFLAGS+= -DDEBUG -g
31YFLAGS+= -t
32LFLAGS+= -d
33SEQFLAGS= -l seq.lst
34.endif
35
36microcode:	7xxx_headers 79xx_headers
37
38aicasm_gram.c aicasm_gram.h: aicasm_gram.y
39	${YACC} ${YFLAGS} $<
40	@mv y.tab.c aicasm_gram.c
41	@mv y.tab.h aicasm_gram.h
42
43aicasm_macro_gram.c aicasm_macro_gram.h: aicasm_macro_gram.y
44	${YACC} -pmm ${YFLAGS} $<
45	@mv y.tab.c aicasm_macro_gram.c
46	@mv y.tab.h aicasm_macro_gram.h
47
487xxx_headers:	aicasm aic7xxx.seq aic7xxx.reg
49	${OBJDIR}./aicasm -I/sys ${SEQFLAGS} -r tempreg.h -o tempseq.h ${.CURDIR}/aic7xxx.seq
50	grep OpenBSD: ${.CURDIR}/aic7xxx.seq | cat - tempseq.h > aic7xxx_seq.h
51	grep OpenBSD: ${.CURDIR}/aic7xxx.reg | cat - tempreg.h > aic7xxx_reg.h
52	mv aic7xxx_seq.h /sys/dev/microcode/aic7xxx/
53	mv aic7xxx_reg.h /sys/dev/microcode/aic7xxx/
54.ifdef DEBUG
55	mv seq.lst /sys/dev/microcode/aic7xxx/seq7xxx.lst
56.endif
57	rm -f tempseq.h tempreg.h
58
5979xx_headers:	aicasm aic79xx.seq aic79xx.reg
60	${OBJDIR}./aicasm -I/sys ${SEQFLAGS} -r tempreg.h -o tempseq.h ${.CURDIR}/aic79xx.seq
61	grep OpenBSD: ${.CURDIR}/aic79xx.seq | cat - tempseq.h > aic79xx_seq.h
62	grep OpenBSD: ${.CURDIR}/aic79xx.reg | cat - tempreg.h > aic79xx_reg.h
63	mv aic79xx_seq.h /sys/dev/microcode/aic7xxx/
64	mv aic79xx_reg.h /sys/dev/microcode/aic7xxx/
65.ifdef DEBUG
66	mv seq.lst /sys/dev/microcode/aic7xxx/seq79xx.lst
67.endif
68	rm -f tempseq.h tempreg.h
69
70.include <bsd.prog.mk>
71