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-10-21 14:23:19 +00:00
|
|
|
#SHORTNAME = libdha.so
|
|
|
|
VSHORTNAME = libdha.so
|
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
|
|
|
|
2002-12-20 21:07:27 +00:00
|
|
|
# If you want libdha to use svgalib_helper for hardware access,
|
|
|
|
# uncomment this statement, and change the -I to the correct directory
|
|
|
|
# that includes svgalib_helper.o:
|
2003-04-08 17:11:19 +00:00
|
|
|
ifneq ($(wildcard svgalib_helper),)
|
|
|
|
CFLAGS += -DDEV_SVGA=\"/dev/svga\" -DCONFIG_SVGAHELPER -Isvgalib_helper/
|
|
|
|
endif
|
2002-12-20 21:07:27 +00:00
|
|
|
|
2002-01-04 10:32:26 +00:00
|
|
|
.SUFFIXES: .c .o
|
|
|
|
|
|
|
|
# .PHONY: all clean
|
|
|
|
|
2002-12-21 17:49:52 +00:00
|
|
|
.c.o: pci_names.c
|
2002-01-04 10:32:26 +00:00
|
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
$(LIBNAME): $(OBJS)
|
2002-10-20 10:41:32 +00:00
|
|
|
#$(CC) -shared $(SONAME_FLAGS) -o $(LIBNAME) $(OBJS) $(LIBS)
|
|
|
|
$(CC) -shared -Wl,-soname -Wl,$(LIBNAME) -o $(LIBNAME) $(OBJS) $(LIBS)
|
2002-01-04 10:32:26 +00:00
|
|
|
ln -sf $(LIBNAME) $(SHORTNAME)
|
2002-10-21 14:23:19 +00:00
|
|
|
ln -sf $(LIBNAME) $(VSHORTNAME)
|
2002-01-04 10:32:26 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2002-12-21 17:49:52 +00:00
|
|
|
depend: pci_names.c
|
2002-01-04 10:32:26 +00:00
|
|
|
$(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
|
|
|
|
2002-12-15 18:22:55 +00:00
|
|
|
uninstall:
|
|
|
|
rm -f $(prefix)/lib/libdha.so $(prefix)/lib/$(SHORTNAME) $(prefix)/lib/$(LIBNAME)
|
|
|
|
ifeq ($(TARGET_OS),OpenBSD)
|
|
|
|
ldconfig -R
|
|
|
|
else
|
|
|
|
ldconfig
|
|
|
|
endif
|
|
|
|
|
2002-01-04 10:32:26 +00:00
|
|
|
#
|
|
|
|
# include dependency files if they exist
|
|
|
|
#
|
|
|
|
ifneq ($(wildcard .depend),)
|
|
|
|
include .depend
|
|
|
|
endif
|