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-02-02 12:14:56 +00:00
|
|
|
SRCS=libdha.c mtrr.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
|
2002-05-12 02:18:52 +00:00
|
|
|
LIBS =
|
|
|
|
ifeq ($(TARGET_OS),OpenBSD)
|
|
|
|
LIBS += -li386
|
|
|
|
endif
|
2002-01-04 10:32:26 +00:00
|
|
|
|
|
|
|
.SUFFIXES: .c .o
|
|
|
|
|
|
|
|
# .PHONY: all clean
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
$(LIBNAME): $(OBJS)
|
2002-05-12 02:18:52 +00:00
|
|
|
$(CC) -shared -o $(LIBNAME) $(OBJS) $(LIBS)
|
2002-01-04 10:32:26 +00:00
|
|
|
ln -sf $(LIBNAME) $(SHORTNAME)
|
|
|
|
|
|
|
|
all: $(LIBNAME) $(SHORTNAME)
|
|
|
|
|
2002-01-12 11:39:07 +00:00
|
|
|
pci_names.c:
|
2002-05-31 22:41:02 +00:00
|
|
|
$(AWK) -f pci_db2c.awk oth/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:
|
2002-01-17 09:01:50 +00:00
|
|
|
mkdir -p $(prefix)/lib
|
|
|
|
install -m 755 -s -p $(LIBNAME) $(prefix)/lib/$(LIBNAME)
|
2002-01-07 09:28:22 +00:00
|
|
|
rm -f $(prefix)/lib/libdha.so
|
2002-05-12 02:18:52 +00:00
|
|
|
ln -sf $(LIBNAME) $(prefix)/lib/$(SHORTNAME)
|
|
|
|
ifeq ($(TARGET_OS),OpenBSD)
|
|
|
|
ldconfig -R
|
|
|
|
else
|
2002-01-04 10:32:26 +00:00
|
|
|
ldconfig
|
2002-05-12 02:18:52 +00:00
|
|
|
endif
|
2002-01-04 10:32:26 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# include dependency files if they exist
|
|
|
|
#
|
|
|
|
ifneq ($(wildcard .depend),)
|
|
|
|
include .depend
|
|
|
|
endif
|