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 |
2489
|
30 LIBCRUFT = ../libcruft.a |
|
31 |
|
32 LIBCRUFT_OBJS = $(CRUFT_OBJ) $(SPECIAL_DEPEND) |
|
33 |
|
34 LIBCRUFT_DEPS = $(LIBCRUFT)($(LIBCRUFT_OBJS)) |
|
35 |
|
36 all: stamp-picdir $(LIBCRUFT) $(CRUFT_PICOBJ) $(SPECIAL_PICDEPEND) |
6
|
37 .PHONY: all |
|
38 |
2489
|
39 # Cancel the default action for when an archive member is out of |
|
40 # date. Instead of inserting the out of date members individually, we |
|
41 # will insert them in batches, even if some of them are up to date. |
|
42 # This is much faster for a large archive like libcruft.a. |
|
43 |
|
44 (%) : % |
|
45 @true |
|
46 |
|
47 $(LIBCRUFT): $(LIBCRUFT_DEPS) |
|
48 $(AR) $(ARFLAGS) $(LIBCRUFT) $(LIBCRUFT_OBJS) |
|
49 $(RANLIB) $(LIBCRUFT) |
|
50 |
|
51 # This is necessary, otherwise we won't have any .o files left when it |
|
52 # comes time to insert them in the archive. |
|
53 |
|
54 .PRECIOUS: $(LIBCRUFT_OBJS) |
|
55 |
1668
|
56 stamp-picdir: |
2676
|
57 @if $(SHARED_LIBS); then \ |
2358
|
58 if [ -n "$(FPICFLAG)" ]; then \ |
|
59 if [ -d pic ]; then \ |
|
60 true ; \ |
|
61 else \ |
2676
|
62 echo "mkdir pic" ; \ |
2358
|
63 mkdir pic ; \ |
|
64 fi ; \ |
|
65 fi ; \ |
|
66 else \ |
|
67 true ; \ |
|
68 fi |
1668
|
69 touch stamp-picdir |
|
70 |
2545
|
71 install:: all |
6
|
72 .PHONY: install |
|
73 |
2545
|
74 uninstall:: |
6
|
75 .PHONY: uninstall |
|
76 |
|
77 tags: $(SOURCES) |
|
78 ctags $(SOURCES) |
|
79 |
|
80 TAGS: $(SOURCES) |
|
81 etags $(SOURCES) |
|
82 |
1459
|
83 clean:: |
2053
|
84 rm -f *.a *.o pic/*.o |
6
|
85 .PHONY: clean |
|
86 |
1459
|
87 mostlyclean:: |
2053
|
88 rm -f *.o pic/*.o |
6
|
89 .PHONY: mostlyclean |
|
90 |
1459
|
91 distclean:: clean |
2053
|
92 rm -f Makefile stamp-picdir |
|
93 -rmdir pic |
1459
|
94 .PHONY: distclean |
|
95 |
2386
|
96 maintainer-clean:: |
|
97 rm -f tags TAGS stamp-picdir Makefile |
2053
|
98 -rmdir pic |
1393
|
99 .PHONY: maintainer-clean |
6
|
100 |
|
101 dist: |
|
102 ln $(EXTERNAL_DISTFILES) ../../`cat ../../.fname`/libcruft/$(THISDIR) |
|
103 .PHONY: dist |