2002-01-04 10:32:26 +00:00
|
|
|
# makefile
|
|
|
|
|
|
|
|
include ../config.mak
|
|
|
|
|
|
|
|
VERSION = 0.1
|
|
|
|
|
2002-01-15 12:10:19 +00:00
|
|
|
ifeq ($(TARGET_OS),CYGWIN)
|
|
|
|
SHORTNAME = libdha.dll
|
|
|
|
else
|
2002-01-04 10:32:26 +00:00
|
|
|
SHORTNAME = libdha.so
|
2002-01-15 12:10:19 +00:00
|
|
|
endif
|
2002-01-04 10:32:26 +00:00
|
|
|
LIBNAME = libdha-$(VERSION).so
|
|
|
|
|
2002-01-12 11:39:07 +00:00
|
|
|
SRCS=libdha.c pci.c pci_names.c
|
2002-01-04 10:32:26 +00:00
|
|
|
OBJS=$(SRCS:.c=.o)
|
|
|
|
|
|
|
|
CFLAGS = $(OPTFLAGS) -fPIC -I. -I.. -Wall -W
|
|
|
|
|
|
|
|
.SUFFIXES: .c .o
|
|
|
|
|
|
|
|
# .PHONY: all clean
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
$(LIBNAME): $(OBJS)
|
|
|
|
$(CC) -shared -o $(LIBNAME) $(OBJS)
|
|
|
|
ln -sf $(LIBNAME) $(SHORTNAME)
|
|
|
|
|
|
|
|
all: $(LIBNAME) $(SHORTNAME)
|
|
|
|
|
2002-01-12 11:39:07 +00:00
|
|
|
pci_names.c:
|
|
|
|
gzip -d -c oth/pci.db.gz >pci.db
|
2002-01-15 14:49:36 +00:00
|
|
|
$(AWK) -f pci_db2c.awk pci.db
|
2002-01-12 11:39:07 +00:00
|
|
|
|
2002-01-04 10:32:26 +00:00
|
|
|
test:
|
|
|
|
$(CC) test.c -o test $(SHORTNAME)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o *.so *~
|
|
|
|
|
|
|
|
distclean:
|
|
|
|
rm -f Makefile.bak *.o *.so test *~ .depend
|
2002-01-12 11:39:07 +00:00
|
|
|
rm -f pci_dev_ids.c pci_ids.h pci_names.c pci_names.h pci_vendors.h pci.db
|
2002-01-04 10:32:26 +00:00
|
|
|
|
|
|
|
dep: depend
|
|
|
|
|
|
|
|
depend:
|
|
|
|
$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
|
|
|
|
|
|
|
|
install:
|
|
|
|
cp $(LIBNAME) $(prefix)/lib/$(LIBNAME)
|
2002-01-07 09:28:22 +00:00
|
|
|
rm -f $(prefix)/lib/libdha.so
|
2002-01-04 10:32:26 +00:00
|
|
|
ln -sf $(LIBNAME) $(prefix)/lib/libdha.so
|
|
|
|
ldconfig
|
|
|
|
|
|
|
|
#
|
|
|
|
# include dependency files if they exist
|
|
|
|
#
|
|
|
|
ifneq ($(wildcard .depend),)
|
|
|
|
include .depend
|
|
|
|
endif
|