patch-2.4.5 linux/drivers/scsi/aic7xxx/aicasm/Makefile

Next file: linux/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
Previous file: linux/drivers/scsi/aic7xxx/aic7xxx_seq.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.4/linux/drivers/scsi/aic7xxx/aicasm/Makefile linux/drivers/scsi/aic7xxx/aicasm/Makefile
@@ -2,17 +2,23 @@
 
 CSRCS=	aicasm.c aicasm_symbol.c
 GENSRCS= aicasm_gram.c aicasm_scan.c
-
-GENHDRS=	y.tab.h
+DEPHDRS= aicdb.h
+GENHDRS= y.tab.h aicdb.h
 
 SRCS=	${GENSRCS} ${CSRCS}
 CLEANFILES= ${GENSRCS} ${GENHDRS} y.output
 # Override default kernel CFLAGS.  This is a userland app.
-AICASM_CFLAGS:= -I/usr/include -ldb1
+AICASM_CFLAGS:= -I/usr/include -I. -ldb
 YFLAGS= -d
 
 NOMAN=	noman
 
+ifneq ($(HOSTCC),)
+AICASM_CC= $(HOSTCC)
+else
+AICASM_CC= $(CC)
+endif
+
 ifdef DEBUG
 CFLAGS+= -DDEBUG -g
 YFLAGS+= -t -v
@@ -21,8 +27,21 @@
 
 .SUFFIXES= .l .y .c
 
-$(PROG): $(SRCS)
-	$(HOSTCC) $(AICASM_CFLAGS) $(SRCS) -o $(PROG)
+$(PROG): $(SRCS) $(DEPHDRS)
+	$(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(PROG)
+
+aicdb.h:
+	@if [ -e "/usr/include/db3/db_185.h" ]; then		\
+		echo "#include <db3/db_185.h>" > aicdb.h;	\
+	 elif [ -e "/usr/include/db2/db_185.h" ]; then		\
+		echo "#include <db2/db_185.h>" > aicdb.h;	\
+	 elif [ -e "/usr/include/db/db_185.h" ]; then		\
+		echo "#include <db/db_185.h>" > aicdb.h;	\
+	 elif [ -e "/usr/include/db_185.h" ]; then		\
+		echo "#include <db_185.h>" > aicdb.h;		\
+	 else							\
+		echo "*** Install db development libraries";	\
+	 fi
 
 clean:
 	rm -f $(CLEANFILES) $(PROG)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)