860
|
1 # @configure_input@ |
6
|
2 # |
|
3 # Common rules for octave's libcruft directories. |
|
4 # |
5775
|
5 # FIXME -- assumes that the libcruft directory tree is only |
2489
|
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 |
6137
|
13 DLL_CDEFS = @CRUFT_DLL_DEFS@ |
|
14 DLL_CXXDEFS = @CRUFT_DLL_DEFS@ |
6087
|
15 |
6
|
16 SOURCES = *.f |
|
17 |
|
18 DISTFILES = Makefile.in $(SOURCES) $(SPECIAL) |
|
19 |
6102
|
20 CRUFT_FSRC = $(wildcard $(srcdir)/*.f) |
|
21 CRUFT_CSRC = $(wildcard $(srcdir)/*.c) |
|
22 CRUFT_CXXSRC = $(wildcard $(srcdir)/*.cc) |
|
23 CRUFT_SRC = $(CRUFT_FSRC) $(CRUFT_CSRC) $(CRUFT_CXXSRC) |
3325
|
24 CRUFT_BASE = $(basename $(notdir $(CRUFT_SRC)) ) |
|
25 CRUFT_OBJ = $(addsuffix .o, $(CRUFT_BASE) ) |
6102
|
26 CRUFT_DEFS = $(patsubst %.f, %.def, $(notdir $(CRUFT_FSRC))) |
6
|
27 |
2036
|
28 ifeq ($(SHARED_LIBS), true) |
|
29 ifdef FPICFLAG |
|
30 CRUFT_PICOBJ := $(addprefix pic/, $(CRUFT_OBJ)) |
3325
|
31 else |
|
32 CRUFT_PICOBJ := $(CRUFT_OBJ) |
2036
|
33 endif |
|
34 endif |
|
35 |
6
|
36 CWD = $(shell pwd) |
|
37 THISDIR = $(notdir $(CWD)) |
|
38 |
2489
|
39 LIBCRUFT_OBJS = $(CRUFT_OBJ) $(SPECIAL_DEPEND) |
|
40 |
3238
|
41 ifeq ($(STATIC_LIBS), true) |
3615
|
42 LIBCRUFT_DEPEND := $(LIBCRUFT_OBJS) |
3238
|
43 endif |
|
44 |
6102
|
45 all: pic $(CRUFT_DEFS) $(LIBCRUFT_DEPEND) $(CRUFT_PICOBJ) $(SPECIAL_PICDEPEND) |
3615
|
46 @echo "warning: run make in parent directory to update libraries" |
6
|
47 .PHONY: all |
|
48 |
2489
|
49 .PRECIOUS: $(LIBCRUFT_OBJS) |
|
50 |
3615
|
51 stmp-pic: pic |
|
52 @if [ -f stmp-pic ]; then \ |
|
53 true; \ |
|
54 else \ |
|
55 echo "touch stmp-pic"; \ |
|
56 touch stmp-pic; \ |
|
57 fi |
|
58 |
3029
|
59 pic: |
|
60 @if [ -d pic ]; then \ |
|
61 true; \ |
2358
|
62 else \ |
3029
|
63 echo "mkdir pic"; \ |
|
64 mkdir pic; \ |
2358
|
65 fi |
1668
|
66 |
3615
|
67 $(CRUFT_PICOBJ): stmp-pic |
|
68 |
6102
|
69 $(CRUFT_DEFS): $(TOPDIR)/libcruft/mkf77def |
|
70 |
|
71 %.def : %.f |
|
72 @echo "making $@ from $<" |
|
73 @$(TOPDIR)/libcruft/mkf77def < $< > $@.t |
|
74 $(top_srcdir)/move-if-change $@.t $@ |
|
75 |
2545
|
76 install:: all |
6
|
77 .PHONY: install |
|
78 |
5223
|
79 install-strip:: all |
|
80 .PHONY: install-strip |
|
81 |
2545
|
82 uninstall:: |
6
|
83 .PHONY: uninstall |
|
84 |
|
85 tags: $(SOURCES) |
|
86 ctags $(SOURCES) |
|
87 |
|
88 TAGS: $(SOURCES) |
|
89 etags $(SOURCES) |
|
90 |
5276
|
91 clean mostlyclean distclean maintainer-clean:: |
6102
|
92 rm -f $(MAKEDEPS) $(CRUFT_OBJ) $(CRUFT_PICOBJ) $(CRUFT_DEFS) |
3615
|
93 -rmdir pic |
|
94 rm -f stmp-pic |
5276
|
95 .PHONY: clean mostlyclean |
6
|
96 |
5276
|
97 distclean maintainer-clean:: |
3029
|
98 rm -f Makefile |
1459
|
99 .PHONY: distclean |
|
100 |
4440
|
101 maintainer-clean:: |
3265
|
102 rm -f tags TAGS |
1393
|
103 .PHONY: maintainer-clean |
6
|
104 |
|
105 dist: |
|
106 ln $(EXTERNAL_DISTFILES) ../../`cat ../../.fname`/libcruft/$(THISDIR) |
|
107 .PHONY: dist |