#************************************************************************ # Description # makefile.unix - Unix makefile for HBA API wrapper library and # associated file # # License: # The contents of this file are subject to the SNIA Public License # Version 1.0 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # # /http://www.snia.org/English/Resources/Code/OpenSource.html # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. # # The Original Code is Unix Makefile for SNIA HBA API Development Kit # # The Initial Developer of the Original Code is: # Dixon Hutchinson, Legato Systems, Inc. (dhutchin@legato.com) # # Contributor(s): # #************************************************************************ # GNU Make is probably required for this makefile #************************************************************************ CC = gcc BUILD_DATE := $(shell date "+%Y/%m/%d %T %Z") REVNUM := 2 MINREVNUM := 2 REVISION = "Rev $(REVNUM).$(MINREVNUM)" # Change the next line to match your company COMPANY := "Legato Systems" ifndef VERSION VERSION := "HBA API ${REVISION} Built by: ${COMPANY} Date: ${BUILD_DATE}" endif define VERS @rm -f version.c @/bin/echo "#ident \"@(#) ${VERSION} \c" > version.c @/bin/echo `date "+%m/%d/%y %H:%M:%S"` " \c" >> version.c @/bin/echo "Subject to SNIA Public License\"" >> version.c @/bin/echo "#ident \""$$\Id:"${VERSION} \c" >> version.c @/bin/echo `date "+%m/%d/%y %H:%M:%S"` " \c" >> version.c @/bin/echo "Subject to SNIA Public License $$\"" >> version.c @echo "" > version.c @$(COMPILE.c) version.c > /dev/null 2>&1 @rm -f version.c endef CFLAGS = -DPOSIX_THREADS=POSIX_THREADS -DUSESYSLOG=USESYSLOG -DUSELOGFILE=USELOGFILE default: libHBAAPI.so all: hbaapitest libHBAAPI.so hbatest: hbaapi.h ${CC} hbatest.c -ldl -o hbatest libHBAAPI.so: HBAAPILIB.c hbaapi.h vendorhbaapi.h ${VERS} ${CC} -fPIC -g -c -Wall HBAAPILIB.c ${CC} -shared -Wl,-soname,libHBAAPI.so -o libHBAAPI.so version.o HBAAPILIB.o -rdynamic -ldl # ${CC} HBAAPILIB.c version.o ${CFLAGS} -DBUILD_DATE=\"'${BUILD_DATE}'\" -g -o libHBAAPI.so -rdynamic -ldl @rm version.o test: FORCE ${CC} -DBUILD_DATE=\"'${BUILD_DATE}'\" test.c -o test hbasample: hbaapi.h libHBAAPI.so vendorhbaapi.h ${CC} hbasample.c -o hbasample.so libHBAAPI.so hbaping.o: hbaping.c $(CC) -c hbaping.c hbaping: hbaapi.h libHBAAPI.so hbaping.o ${CC} hbaping.o -ldl libHBAAPI.so -o hbaping hbaapitest.o: hbaapitest.c ${CC} -c hbaapitest.c hbaapitest: hbaapitest.o libHBAAPI.so ${CC} hbaapitest.o -ldl libHBAAPI.so -o hbaapitest FORCE: tarball: rm -rf hbaapi_src_$(REVNUM).$(MINREVNUM) mkdir hbaapi_src_$(REVNUM).$(MINREVNUM) (cd hbaapi_src_$(REVNUM).$(MINREVNUM);\ ln ../hba.conf ../hba.reg ../hbaapi.h ../vendorhbaapi.h \ ../HBAAPILIB.c ../hbaapitest.c ../hbasample.c ../hbasample.h \ ../makefile.nt ../makefile.unix ../readme.txt \ .) tar cf - hbaapi_src_$(REVNUM).$(MINREVNUM) | gzip -9 > hbaapi_src_$(REVNUM).$(MINREVNUM).tgz rm -rf hbaapi_src_$(REVNUM).$(MINREVNUM) clean: rm -f *.so rm -f hbaapitest rm *.o