2002-01-04 10:32:26 +00:00
|
|
|
# makefile
|
|
|
|
|
|
|
|
include ../config.mak
|
|
|
|
|
2002-10-20 08:43:09 +00:00
|
|
|
MAJOR_VERSION = 0
|
|
|
|
MINOR_VERSION = 1
|
|
|
|
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION)
|
|
|
|
|
2002-01-04 10:32:26 +00:00
|
|
|
|
2002-01-15 12:10:19 +00:00
|
|
|
ifeq ($(TARGET_OS),CYGWIN)
|
|
|
|
SHORTNAME = libdha.dll
|
|
|
|
else
|
2002-10-20 08:43:09 +00:00
|
|
|
SHORTNAME = libdha.so.$(MAJOR_VERSION)
|
|
|
|
SONAME_FLAGS = -Wl,-soname,$(SHORTNAME)
|
2002-01-15 12:10:19 +00:00
|
|
|
endif
|
2002-08-14 21:44:56 +00:00
|
|
|
LIBNAME = libdha.so.$(VERSION)
|
2002-01-04 10:32:26 +00:00
|
|
|
|
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)
|
|
|
|
|
2002-08-22 23:29:46 +00:00
|
|
|
CFLAGS = $(OPTFLAGS) -fPIC -I. -I..
|
2002-05-12 02:18:52 +00:00
|
|
|
LIBS =
|
|
|
|
ifeq ($(TARGET_OS),OpenBSD)
|
2002-07-03 18:59:47 +00:00
|
|
|
ifeq ($(TARGET_ARCH_X86),yes)
|
2002-05-12 02:18:52 +00:00
|
|
|
LIBS += -li386
|
|
|
|
endif
|
2002-07-03 18:59:47 +00:00
|
|
|
endif
|
2002-01-04 10:32:26 +00:00
|
|
|
|
|
|
|
.SUFFIXES: .c .o
|
|
|
|
|
|
|
|
# .PHONY: all clean
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
$(LIBNAME): $(OBJS)
|
2002-10-20 08:43:09 +00:00
|
|
|
$(CC) -shared $(SONAME_FLAGS) -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:
|
2002-10-20 08:43:09 +00:00
|
|
|
rm -f *.o *.so *.so.* *~
|
2002-01-04 10:32:26 +00:00
|
|
|
|
|
|
|
distclean:
|
2002-10-20 08:43:09 +00:00
|
|
|
rm -f Makefile.bak *.o *.so *.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
|