2002-01-04 10:32:26 +00:00
|
|
|
# makefile
|
|
|
|
|
|
|
|
include ../config.mak
|
|
|
|
|
2004-06-26 13:48:35 +00:00
|
|
|
MAJOR_VERSION = 1
|
|
|
|
MINOR_VERSION = 0
|
2002-10-20 08:43:09 +00:00
|
|
|
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
|
2004-03-26 12:15:54 +00:00
|
|
|
ifeq ($(TARGET_WIN32),yes)
|
2003-10-22 20:17:23 +00:00
|
|
|
LIBNAME = libdha.a
|
|
|
|
SHORTNAME = libdha.a
|
|
|
|
else
|
2002-08-14 21:44:56 +00:00
|
|
|
LIBNAME = libdha.so.$(VERSION)
|
2003-10-22 20:17:23 +00:00
|
|
|
endif
|
2002-01-04 10:32:26 +00:00
|
|
|
|
2006-03-25 10:38:37 +00:00
|
|
|
SRCS=libdha.c \
|
|
|
|
mtrr.c \
|
|
|
|
pci.c \
|
|
|
|
pci_names.c \
|
|
|
|
|
2002-01-04 10:32:26 +00:00
|
|
|
OBJS=$(SRCS:.c=.o)
|
|
|
|
|
2006-10-23 10:02:21 +00:00
|
|
|
CFLAGS = -fPIC -I. -I.. $(OPTFLAGS)
|
2006-10-19 21:00:35 +00:00
|
|
|
|
2002-05-12 02:18:52 +00:00
|
|
|
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)
|
2004-03-26 12:15:54 +00:00
|
|
|
ifeq ($(TARGET_WIN32),yes)
|
2003-10-22 20:17:23 +00:00
|
|
|
$(AR) r $(LIBNAME) $(OBJS)
|
|
|
|
else
|
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)
|
2003-10-22 20:17:23 +00:00
|
|
|
endif
|
2002-01-04 10:32:26 +00:00
|
|
|
|
|
|
|
all: $(LIBNAME) $(SHORTNAME)
|
|
|
|
|
2007-01-06 15:08:04 +00:00
|
|
|
pci_names.c: oth/pci.db
|
|
|
|
LC_ALL=C $(AWK) -f pci_db2c.awk $<
|
2002-01-12 11:39:07 +00:00
|
|
|
|
2002-01-04 10:32:26 +00:00
|
|
|
test:
|
|
|
|
$(CC) test.c -o test $(SHORTNAME)
|
|
|
|
|
|
|
|
clean:
|
2006-01-27 00:06:42 +00:00
|
|
|
rm -f *.o *.a *~ *.so *.so.*
|
2007-01-10 16:54:44 +00:00
|
|
|
rm -f pci_*.c pci_*.h pci.db
|
2002-01-04 10:32:26 +00:00
|
|
|
|
2006-01-27 00:06:42 +00:00
|
|
|
distclean: clean
|
|
|
|
rm -f .depend test
|
2002-01-04 10:32:26 +00:00
|
|
|
|
2006-11-20 11:18:01 +00:00
|
|
|
dep depend: pci_names.c
|
2002-01-04 10:32:26 +00:00
|
|
|
$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
|
|
|
|
|
|
|
|
install:
|
2006-04-13 16:49:56 +00:00
|
|
|
-mkdir -p $(LIBDIR)
|
2006-01-03 00:24:17 +00:00
|
|
|
install -m 755 $(INSTALLSTRIP) -p $(LIBNAME) $(LIBDIR)/$(LIBNAME)
|
2005-01-01 14:45:11 +00:00
|
|
|
rm -f $(LIBDIR)/libdha.so
|
|
|
|
ln -sf $(LIBNAME) $(LIBDIR)/$(SHORTNAME)
|
2002-05-12 02:18:52 +00:00
|
|
|
ifeq ($(TARGET_OS),OpenBSD)
|
2006-03-26 21:17:14 +00:00
|
|
|
-ldconfig -R
|
2002-05-12 02:18:52 +00:00
|
|
|
else
|
2006-03-26 21:17:14 +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:
|
2005-01-01 14:45:11 +00:00
|
|
|
rm -f $(LIBDIR)/libdha.so $(LIBDIR)/$(SHORTNAME) $(LIBDIR)/$(LIBNAME)
|
2002-12-15 18:22:55 +00:00
|
|
|
ifeq ($(TARGET_OS),OpenBSD)
|
2006-03-26 21:17:14 +00:00
|
|
|
-ldconfig -R
|
2002-12-15 18:22:55 +00:00
|
|
|
else
|
2006-03-26 21:17:14 +00:00
|
|
|
-ldconfig
|
2002-12-15 18:22:55 +00:00
|
|
|
endif
|
|
|
|
|
2002-01-04 10:32:26 +00:00
|
|
|
ifneq ($(wildcard .depend),)
|
|
|
|
include .depend
|
|
|
|
endif
|