typo fixes
[mplayer/greg.git] / libdha / Makefile
blob80a179b9043b7830f786af67c1e29ff9ddaecfc2
1 # makefile
3 include ../config.mak
5 MAJOR_VERSION = 1
6 MINOR_VERSION = 0
7 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION)
10 ifeq ($(TARGET_OS),CYGWIN)
11 SHORTNAME = libdha.dll
12 else
13 SHORTNAME = libdha.so.$(MAJOR_VERSION)
14 SONAME_FLAGS = -Wl,-soname,$(SHORTNAME)
15 #SHORTNAME = libdha.so
16 VSHORTNAME = libdha.so
17 endif
18 ifeq ($(TARGET_WIN32),yes)
19 LIBNAME = libdha.a
20 SHORTNAME = libdha.a
21 else
22 LIBNAME = libdha.so.$(VERSION)
23 endif
25 SRCS=libdha.c \
26 mtrr.c \
27 pci.c \
28 pci_names.c \
30 OBJS=$(SRCS:.c=.o)
32 CFLAGS = $(OPTFLAGS) -fPIC -I. -I..
33 LIBS =
34 ifeq ($(TARGET_OS),OpenBSD)
35 ifeq ($(TARGET_ARCH_X86),yes)
36 LIBS += -li386
37 endif
38 endif
40 # If you want libdha to use svgalib_helper for hardware access,
41 # uncomment this statement, and change the -I to the correct directory
42 # that includes svgalib_helper.o:
43 ifneq ($(wildcard svgalib_helper),)
44 CFLAGS += -DDEV_SVGA=\"/dev/svga\" -DCONFIG_SVGAHELPER -Isvgalib_helper/
45 endif
47 .SUFFIXES: .c .o
49 # .PHONY: all clean
51 .c.o: pci_names.c
52 $(CC) -c $(CFLAGS) -o $@ $<
54 $(LIBNAME): $(OBJS)
55 ifeq ($(TARGET_WIN32),yes)
56 $(AR) r $(LIBNAME) $(OBJS)
57 else
58 #$(CC) -shared $(SONAME_FLAGS) -o $(LIBNAME) $(OBJS) $(LIBS)
59 $(CC) -shared -Wl,-soname -Wl,$(LIBNAME) -o $(LIBNAME) $(OBJS) $(LIBS)
60 ln -sf $(LIBNAME) $(SHORTNAME)
61 ln -sf $(LIBNAME) $(VSHORTNAME)
62 endif
64 all: $(LIBNAME) $(SHORTNAME)
66 pci_names.c:
67 LC_ALL=C $(AWK) -f pci_db2c.awk oth/pci.db
69 test:
70 $(CC) test.c -o test $(SHORTNAME)
72 clean:
73 rm -f *.o *.a *~ *.so *.so.*
75 distclean: clean
76 rm -f .depend test
77 rm -f pci_dev_ids.c pci_ids.h pci_names.c pci_names.h pci_vendors.h pci.db
79 dep: depend
81 depend: pci_names.c
82 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
84 install:
85 -mkdir -p $(LIBDIR)
86 install -m 755 $(INSTALLSTRIP) -p $(LIBNAME) $(LIBDIR)/$(LIBNAME)
87 rm -f $(LIBDIR)/libdha.so
88 ln -sf $(LIBNAME) $(LIBDIR)/$(SHORTNAME)
89 ifeq ($(TARGET_OS),OpenBSD)
90 -ldconfig -R
91 else
92 -ldconfig
93 endif
95 uninstall:
96 rm -f $(LIBDIR)/libdha.so $(LIBDIR)/$(SHORTNAME) $(LIBDIR)/$(LIBNAME)
97 ifeq ($(TARGET_OS),OpenBSD)
98 -ldconfig -R
99 else
100 -ldconfig
101 endif
104 # include dependency files if they exist
106 ifneq ($(wildcard .depend),)
107 include .depend
108 endif