3973
|
1 # makefile
|
|
2
|
|
3 include ../config.mak
|
|
4
|
|
5 VERSION = 0.1
|
|
6
|
|
7 SHORTNAME = libdha.so
|
|
8 LIBNAME = libdha-$(VERSION).so
|
|
9
|
|
10 SRCS=libdha.c pci.c
|
|
11 OBJS=$(SRCS:.c=.o)
|
|
12
|
|
13 CFLAGS = $(OPTFLAGS) -fPIC -I. -I.. -Wall -W
|
|
14
|
|
15 .SUFFIXES: .c .o
|
|
16
|
|
17 # .PHONY: all clean
|
|
18
|
|
19 .c.o:
|
|
20 $(CC) -c $(CFLAGS) -o $@ $<
|
|
21
|
|
22 $(LIBNAME): $(OBJS)
|
|
23 $(CC) -shared -o $(LIBNAME) $(OBJS)
|
|
24 ln -sf $(LIBNAME) $(SHORTNAME)
|
|
25
|
|
26 all: $(LIBNAME) $(SHORTNAME)
|
|
27
|
|
28 test:
|
|
29 $(CC) test.c -o test $(SHORTNAME)
|
|
30
|
|
31 clean:
|
|
32 rm -f *.o *.so *~
|
|
33
|
|
34 distclean:
|
|
35 rm -f Makefile.bak *.o *.so test *~ .depend
|
|
36
|
|
37 dep: depend
|
|
38
|
|
39 depend:
|
|
40 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
|
|
41
|
|
42 install:
|
|
43 cp $(LIBNAME) $(prefix)/lib/$(LIBNAME)
|
|
44 rm $(prefix)/lib/libdha.so
|
|
45 ln -sf $(LIBNAME) $(prefix)/lib/libdha.so
|
|
46 ldconfig
|
|
47
|
|
48 #
|
|
49 # include dependency files if they exist
|
|
50 #
|
|
51 ifneq ($(wildcard .depend),)
|
|
52 include .depend
|
|
53 endif
|