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 |
6281
|
16 CRUFT_FSRC = $(addprefix $(srcdir)/, $(FSRC)) |
|
17 CRUFT_CSRC = $(addprefix $(srcdir)/, $(CSRC)) |
|
18 CRUFT_CXXSRC = $(addprefix $(srcdir)/, $(CXXSRC)) |
6
|
19 |
6102
|
20 CRUFT_SRC = $(CRUFT_FSRC) $(CRUFT_CSRC) $(CRUFT_CXXSRC) |
6488
|
21 |
|
22 CRUFT_FBASE = $(basename $(notdir $(CRUFT_FSRC))) |
|
23 CRUFT_CBASE = $(basename $(notdir $(CRUFT_CSRC))) |
|
24 CRUFT_CXXBASE = $(basename $(notdir $(CRUFT_CXXSRC))) |
|
25 |
|
26 CRUFT_BASE = $(CRUFT_FBASE) $(CRUFT_CBASE) $(CRUFT_CXXBASE) |
|
27 |
|
28 CRUFT_FOBJ = $(addsuffix .o, $(CRUFT_FBASE) ) |
|
29 CRUFT_COBJ = $(addsuffix .o, $(CRUFT_CBASE) ) |
|
30 CRUFT_CXXOBJ = $(addsuffix .o, $(CRUFT_CXXBASE) ) |
|
31 |
|
32 CRUFT_OBJ = $(CRUFT_FOBJ) $(CRUFT_COBJ) $(CRUFT_CXXOBJ) |
|
33 |
|
34 CRUFT_FDEFS = $(patsubst %.f, %.def, $(notdir $(CRUFT_FSRC))) |
|
35 CRUFT_CDEFS = $(patsubst %.c, %.def, $(notdir $(CRUFT_CSRC))) |
|
36 CRUFT_CXXDEFS = $(patsubst %.cc, %.def, $(notdir $(CRUFT_CXXSRC))) |
|
37 |
|
38 CRUFT_DEFS = $(CRUFT_FDEFS) $(CRUFT_CDEFS) $(CRUFT_CXXDEFS) |
6
|
39 |
6281
|
40 DISTFILES = Makefile.in $(CRUFT_SRC) $(SPECIAL) |
|
41 |
2036
|
42 ifeq ($(SHARED_LIBS), true) |
|
43 ifdef FPICFLAG |
6488
|
44 CRUFT_FPICOBJ := $(addprefix pic/, $(CRUFT_FOBJ)) |
|
45 else |
|
46 CRUFT_FPICOBJ := $(CRUFT_FOBJ) |
|
47 endif |
|
48 ifdef CPICFLAG |
|
49 CRUFT_CPICOBJ := $(addprefix pic/, $(CRUFT_COBJ)) |
3325
|
50 else |
6488
|
51 CRUFT_CPICOBJ := $(CRUFT_COBJ) |
2036
|
52 endif |
6488
|
53 ifdef CXXPICFLAG |
|
54 CRUFT_CXXPICOBJ := $(addprefix pic/, $(CRUFT_CXXOBJ)) |
|
55 else |
|
56 CRUFT_CXXPICOBJ := $(CRUFT_CXXOBJ) |
|
57 endif |
|
58 CRUFT_PICOBJ := $(CRUFT_FPICOBJ) $(CRUFT_CPICOBJ) $(CRUFT_CXXPICOBJ) |
2036
|
59 endif |
|
60 |
6
|
61 CWD = $(shell pwd) |
|
62 THISDIR = $(notdir $(CWD)) |
|
63 |
3238
|
64 ifeq ($(STATIC_LIBS), true) |
6488
|
65 LIBCRUFT_DEPEND := $(CRUFT_OBJ) |
|
66 .PRECIOUS: $(CRUFT_OBJ) |
3238
|
67 endif |
|
68 |
6488
|
69 ifeq ($(SHARED_LIBS), true) |
|
70 LIBCRUFT_PICDEPEND := $(CRUFT_PICOBJ) |
|
71 .PRECIOUS: $(CRUFT_PICOBJ) |
|
72 endif |
|
73 |
|
74 all: pic $(CRUFT_DEFS) $(LIBCRUFT_DEPEND) $(LIBCRUFT_PICDEPEND) |
3615
|
75 @echo "warning: run make in parent directory to update libraries" |
6
|
76 .PHONY: all |
|
77 |
3615
|
78 stmp-pic: pic |
|
79 @if [ -f stmp-pic ]; then \ |
|
80 true; \ |
|
81 else \ |
|
82 echo "touch stmp-pic"; \ |
|
83 touch stmp-pic; \ |
|
84 fi |
|
85 |
3029
|
86 pic: |
|
87 @if [ -d pic ]; then \ |
|
88 true; \ |
2358
|
89 else \ |
3029
|
90 echo "mkdir pic"; \ |
|
91 mkdir pic; \ |
2358
|
92 fi |
1668
|
93 |
3615
|
94 $(CRUFT_PICOBJ): stmp-pic |
|
95 |
6102
|
96 $(CRUFT_DEFS): $(TOPDIR)/libcruft/mkf77def |
|
97 |
|
98 %.def : %.f |
|
99 @echo "making $@ from $<" |
6152
|
100 @$(TOPDIR)/libcruft/mkf77def < $< > $@-t |
|
101 @$(simple-move-if-change-rule) |
6102
|
102 |
2545
|
103 install:: all |
6
|
104 .PHONY: install |
|
105 |
5223
|
106 install-strip:: all |
|
107 .PHONY: install-strip |
|
108 |
2545
|
109 uninstall:: |
6
|
110 .PHONY: uninstall |
|
111 |
|
112 tags: $(SOURCES) |
|
113 ctags $(SOURCES) |
|
114 |
|
115 TAGS: $(SOURCES) |
|
116 etags $(SOURCES) |
|
117 |
5276
|
118 clean mostlyclean distclean maintainer-clean:: |
6102
|
119 rm -f $(MAKEDEPS) $(CRUFT_OBJ) $(CRUFT_PICOBJ) $(CRUFT_DEFS) |
3615
|
120 -rmdir pic |
|
121 rm -f stmp-pic |
5276
|
122 .PHONY: clean mostlyclean |
6
|
123 |
5276
|
124 distclean maintainer-clean:: |
3029
|
125 rm -f Makefile |
1459
|
126 .PHONY: distclean |
|
127 |
4440
|
128 maintainer-clean:: |
3265
|
129 rm -f tags TAGS |
1393
|
130 .PHONY: maintainer-clean |
6
|
131 |
|
132 dist: |
6467
|
133 ln $(EXTERNAL_DISTFILES) ../../`cat ../../.fname`/libcruft/$(THISDIR) |
6
|
134 .PHONY: dist |