860
|
1 # @configure_input@ |
6
|
2 # |
|
3 # Common rules for octave's libcruft directories. |
|
4 # |
2489
|
5 # XXX FIXME XXX -- assumes that the libcruft directory tree is only |
|
6 # one level deep. |
|
7 # |
6
|
8 # John W. Eaton |
1452
|
9 # jwe@bevo.che.wisc.edu |
|
10 # University of Wisconsin-Madison |
6
|
11 # Department of Chemical Engineering |
|
12 |
|
13 SOURCES = *.f |
|
14 |
|
15 DISTFILES = Makefile.in $(SOURCES) $(SPECIAL) |
|
16 |
|
17 CRUFT_FSRC = $(wildcard $(srcdir)/*.f) |
|
18 CRUFT_BASE = $(notdir $(CRUFT_FSRC)) |
|
19 CRUFT_OBJ = $(patsubst %.f, %.o, $(CRUFT_BASE)) |
|
20 |
2036
|
21 ifeq ($(SHARED_LIBS), true) |
|
22 ifdef FPICFLAG |
|
23 CRUFT_PICOBJ := $(addprefix pic/, $(CRUFT_OBJ)) |
|
24 endif |
|
25 endif |
|
26 |
6
|
27 CWD = $(shell pwd) |
|
28 THISDIR = $(notdir $(CWD)) |
|
29 |
3034
|
30 LIBCRUFT := ../libcruft.$(LIBEXT) |
|
31 |
|
32 ifeq ($(STATIC_LIBS), true) |
|
33 LIBCRUFT_DEPEND := $(LIBCRUFT) |
|
34 endif |
2489
|
35 |
|
36 LIBCRUFT_OBJS = $(CRUFT_OBJ) $(SPECIAL_DEPEND) |
|
37 |
|
38 LIBCRUFT_DEPS = $(LIBCRUFT)($(LIBCRUFT_OBJS)) |
|
39 |
3034
|
40 all: pic $(LIBCRUFT_DEPEND) $(CRUFT_PICOBJ) $(SPECIAL_PICDEPEND) |
6
|
41 .PHONY: all |
|
42 |
2489
|
43 # Cancel the default action for when an archive member is out of |
|
44 # date. Instead of inserting the out of date members individually, we |
|
45 # will insert them in batches, even if some of them are up to date. |
|
46 # This is much faster for a large archive like libcruft.a. |
|
47 |
|
48 (%) : % |
|
49 @true |
|
50 |
|
51 $(LIBCRUFT): $(LIBCRUFT_DEPS) |
3039
|
52 $(AR) $(ARFLAGS) $@ $^ |
|
53 $(RANLIB) $@ |
2489
|
54 |
|
55 # This is necessary, otherwise we won't have any .o files left when it |
|
56 # comes time to insert them in the archive. |
|
57 |
|
58 .PRECIOUS: $(LIBCRUFT_OBJS) |
|
59 |
3029
|
60 pic: |
|
61 @if [ -d pic ]; then \ |
|
62 true; \ |
2358
|
63 else \ |
3029
|
64 echo "mkdir pic"; \ |
|
65 mkdir pic; \ |
2358
|
66 fi |
1668
|
67 |
2545
|
68 install:: all |
6
|
69 .PHONY: install |
|
70 |
2545
|
71 uninstall:: |
6
|
72 .PHONY: uninstall |
|
73 |
|
74 tags: $(SOURCES) |
|
75 ctags $(SOURCES) |
|
76 |
|
77 TAGS: $(SOURCES) |
|
78 etags $(SOURCES) |
|
79 |
1459
|
80 clean:: |
2053
|
81 rm -f *.a *.o pic/*.o |
6
|
82 .PHONY: clean |
|
83 |
1459
|
84 mostlyclean:: |
2053
|
85 rm -f *.o pic/*.o |
6
|
86 .PHONY: mostlyclean |
|
87 |
1459
|
88 distclean:: clean |
3029
|
89 rm -f Makefile |
2053
|
90 -rmdir pic |
1459
|
91 .PHONY: distclean |
|
92 |
2386
|
93 maintainer-clean:: |
3029
|
94 rm -f tags TAGS Makefile |
2053
|
95 -rmdir pic |
1393
|
96 .PHONY: maintainer-clean |
6
|
97 |
|
98 dist: |
|
99 ln $(EXTERNAL_DISTFILES) ../../`cat ../../.fname`/libcruft/$(THISDIR) |
|
100 .PHONY: dist |