1## Copyright 2004,2007-2012 IPB, Universite de Bordeaux, INRIA & CNRS
2##
3## This file is part of the Scotch software package for static mapping,
4## graph partitioning and sparse matrix ordering.
5##
6## This software is governed by the CeCILL-C license under French law
7## and abiding by the rules of distribution of free software. You can
8## use, modify and/or redistribute the software under the terms of the
9## CeCILL-C license as circulated by CEA, CNRS and INRIA at the following
10## URL: "http://www.cecill.info".
11##
12## As a counterpart to the access to the source code and rights to copy,
13## modify and redistribute granted by the license, users are provided
14## only with a limited warranty and the software's author, the holder of
15## the economic rights, and the successive licensors have only limited
16## liability.
17##
18## In this respect, the user's attention is drawn to the risks associated
19## with loading, using, modifying and/or developing or reproducing the
20## software by the user in light of its specific status of free software,
21## that may mean that it is complicated to manipulate, and that also
22## therefore means that it is reserved for developers and experienced
23## professionals having in-depth computer knowledge. Users are therefore
24## encouraged to load and test the software's suitability as regards
25## their requirements in conditions enabling the security of their
26## systems and/or data to be ensured and, more generally, to use and
27## operate it in the same conditions as regards security.
28##
29## The fact that you are presently reading this means that you have had
30## knowledge of the CeCILL-C license and that you accept its terms.
31##
32
33bindir		= ../../bin
34includedir	= ../../include
35libdir		= ../../lib
36
37##
38##  General inference rules.
39##
40
41include ../Makefile.inc
42
43%$(EXE)	:	%$(OBJ)
44		 		$(CC) $(CFLAGS) -I$(includedir) -I../libscotch $(<) -o $(@) -L$(libdir) -l$(SCOTCHLIB) -lscotch -l$(SCOTCHLIB)errexit $(LDFLAGS)
45
46%$(OBJ)	:	%.c
47				$(CC) $(CFLAGS) -I$(includedir) -I../libscotch -c $(<) -o $(@)
48
49%$(EXE)	:	%.c
50		 		$(CC) $(CFLAGS) -I$(includedir) -I../libscotch $(<) -o $(@) -L$(libdir) -l$(SCOTCHLIB) -lscotch -l$(SCOTCHLIB)errexit $(LDFLAGS)
51
52##
53##  Project rules.
54##
55
56.PHONY				:	ptscotch	scotch	ptinstall	install	clean	realclean
57
58scotch				:
59					$(MAKE) CC="$(CCS)" SCOTCHLIB=scotch	\
60					acpl$(EXE)				\
61					amk_ccc$(EXE)				\
62					amk_fft2$(EXE)				\
63					amk_grf$(EXE)				\
64					amk_hy$(EXE)				\
65					amk_m2$(EXE)				\
66					amk_p2$(EXE)				\
67					atst$(EXE)				\
68					gbase$(EXE)				\
69					gcv$(EXE)				\
70					gmap$(EXE)				\
71					gmk_hy$(EXE)				\
72					gmk_m2$(EXE)				\
73					gmk_m3$(EXE)				\
74					gmk_msh$(EXE)				\
75					gmk_ub2$(EXE)				\
76					gmtst$(EXE)				\
77					gord$(EXE)				\
78					gotst$(EXE)				\
79					gout$(EXE)				\
80					gpart$(EXE)				\
81					gscat$(EXE)				\
82					gtst$(EXE)				\
83					mcv$(EXE)				\
84					mmk_m2$(EXE)				\
85					mmk_m3$(EXE)				\
86					mord$(EXE)				\
87					mtst$(EXE)
88
89ptscotch			:
90					$(MAKE) CC="$(CCP)" SCOTCHLIB=ptscotch	\
91					dggath$(EXE)				\
92					dgmap$(EXE)				\
93					dgord$(EXE)				\
94					dgpart$(EXE)				\
95					dgscat$(EXE)				\
96					dgtst$(EXE)
97
98install				:	scotch
99					-$(CP) acpl$(EXE) amk_ccc$(EXE) amk_fft2$(EXE) amk_grf$(EXE) amk_hy$(EXE) amk_m2$(EXE) amk_p2$(EXE) atst$(EXE) gbase$(EXE) gcv$(EXE) gmap$(EXE) gmk_hy$(EXE) gmk_m2$(EXE) gmk_m3$(EXE) gmk_msh$(EXE) gmk_ub2$(EXE) gmtst$(EXE) gord$(EXE) gotst$(EXE) gout$(EXE) gpart$(EXE) *gtst$(EXE) gscat$(EXE) mcv$(EXE) mmk_m2$(EXE) mmk_m3$(EXE) mord$(EXE) mtst$(EXE) $(bindir)
100
101ptinstall			:	ptscotch
102					-$(CP) dggath$(EXE) dgmap$(EXE) dgord$(EXE) dgpart$(EXE) dgscat$(EXE) dgtst$(EXE) $(bindir)
103
104clean				:
105					-$(RM) *~ *$(OBJ) acpl$(EXE) amk_ccc$(EXE) amk_fft2$(EXE) amk_grf$(EXE) amk_hy$(EXE) amk_m2$(EXE) amk_p2$(EXE) atst$(EXE) gbase$(EXE) gcv$(EXE) *ggath$(EXE) *gmap$(EXE) gmk_hy$(EXE) gmk_m2$(EXE) gmk_m3$(EXE) gmk_msh$(EXE) gmk_ub2$(EXE) gmtst$(EXE) *gord$(EXE) gotst$(EXE) gout$(EXE) *gpart$(EXE) *gscat$(EXE) *gtst$(EXE) mcv$(EXE) mmk_m2$(EXE) mmk_m3$(EXE) mord$(EXE) mtst$(EXE)
106
107realclean			:	clean
108
109##
110##  Todo list.
111##
112
113acpl$(EXE)			:	acpl.c					\
114					../libscotch/module.h			\
115					../libscotch/common.h			\
116					$(includedir)/scotch.h			\
117					$(libdir)/libscotch$(LIB)		\
118					$(libdir)/libscotcherrexit$(LIB)	\
119					acpl.h
120
121amk_ccc$(EXE)			:	amk_ccc.c				\
122					../libscotch/module.h			\
123					../libscotch/common.h			\
124					$(includedir)/scotch.h			\
125					$(libdir)/libscotch$(LIB)		\
126					$(libdir)/libscotcherrexit$(LIB)	\
127					amk_ccc.h
128
129amk_fft2$(EXE)			:	amk_fft2.c				\
130					../libscotch/module.h			\
131					../libscotch/common.h			\
132					$(includedir)/scotch.h			\
133					$(libdir)/libscotch$(LIB)		\
134					$(libdir)/libscotcherrexit$(LIB)	\
135					amk_fft2.h
136
137amk_grf$(EXE)			:	amk_grf.c				\
138					../libscotch/module.h			\
139					../libscotch/common.h			\
140					$(includedir)/scotch.h			\
141					$(libdir)/libscotch$(LIB)		\
142					$(libdir)/libscotcherrexit$(LIB)	\
143					amk_grf.h
144
145amk_hy$(EXE)			:	amk_hy.c				\
146					../libscotch/module.h			\
147					../libscotch/common.h			\
148					$(includedir)/scotch.h			\
149					$(libdir)/libscotch$(LIB)		\
150					$(libdir)/libscotcherrexit$(LIB)	\
151					amk_hy.h
152
153amk_m2$(EXE)			:	amk_m2.c				\
154					../libscotch/module.h			\
155					../libscotch/common.h			\
156					$(includedir)/scotch.h			\
157					$(libdir)/libscotch$(LIB)		\
158					$(libdir)/libscotcherrexit$(LIB)	\
159					amk_m2.h
160
161amk_p2$(EXE)			:	amk_p2.c				\
162					../libscotch/module.h			\
163					../libscotch/common.h			\
164					$(includedir)/scotch.h			\
165					$(libdir)/libscotch$(LIB)		\
166					$(libdir)/libscotcherrexit$(LIB)	\
167					amk_p2.h
168
169atst$(EXE)			:	atst.c					\
170					../libscotch/module.h			\
171					../libscotch/common.h			\
172					$(includedir)/scotch.h			\
173					$(libdir)/libscotch$(LIB)		\
174					$(libdir)/libscotcherrexit$(LIB)	\
175					atst.h
176
177dggath$(EXE)			:	dggath.c				\
178					../libscotch/module.h			\
179					../libscotch/common.h			\
180					$(includedir)/ptscotch.h		\
181					$(libdir)/libscotch$(LIB)		\
182					$(libdir)/libptscotch$(LIB)		\
183					$(libdir)/libptscotcherrexit$(LIB)	\
184					dggath.h
185
186dgmap$(EXE)			:	dgmap.c					\
187					../libscotch/module.h			\
188					../libscotch/common.h			\
189					$(includedir)/ptscotch.h		\
190					$(libdir)/libscotch$(LIB)		\
191					$(libdir)/libptscotch$(LIB)		\
192					$(libdir)/libptscotcherrexit$(LIB)	\
193					dgmap.h
194
195dgord$(EXE)			:	dgord.c					\
196					../libscotch/module.h			\
197					../libscotch/common.h			\
198					$(includedir)/ptscotch.h		\
199					$(libdir)/libscotch$(LIB)		\
200					$(libdir)/libptscotch$(LIB)		\
201					$(libdir)/libptscotcherrexit$(LIB)	\
202					dgord.h
203
204dgpart$(EXE)			:	dgmap.c					\
205					../libscotch/module.h			\
206					../libscotch/common.h			\
207					$(includedir)/ptscotch.h		\
208					$(libdir)/libscotch$(LIB)		\
209					$(libdir)/libptscotch$(LIB)		\
210					$(libdir)/libptscotcherrexit$(LIB)	\
211					dgmap.h
212			 		$(CC) $(CFLAGS) -I$(includedir) -I../libscotch $(<) -DSCOTCH_COMPILE_PART -o $(@) -L$(libdir) -lptscotch -lscotch -lptscotcherrexit $(LDFLAGS)
213
214dgscat$(EXE)			:	dgscat.c				\
215					../libscotch/module.h			\
216					../libscotch/common.h			\
217					$(includedir)/ptscotch.h		\
218					$(libdir)/libscotch$(LIB)		\
219					$(libdir)/libptscotch$(LIB)		\
220					$(libdir)/libptscotcherrexit$(LIB)	\
221					dgscat.h
222
223dgtst$(EXE)			:	dgtst.c					\
224					../libscotch/module.h			\
225					../libscotch/common.h			\
226					$(includedir)/ptscotch.h		\
227					$(libdir)/libscotch$(LIB)		\
228					$(libdir)/libptscotch$(LIB)		\
229					$(libdir)/libptscotcherrexit$(LIB)	\
230					dgtst.h
231
232gbase$(EXE)			:	gbase.c					\
233					../libscotch/module.h			\
234					../libscotch/common.h			\
235					$(includedir)/scotch.h			\
236					$(libdir)/libscotch$(LIB)		\
237					$(libdir)/libscotcherrexit$(LIB)	\
238					gbase.h
239
240gcv$(EXE)			:	gcv.c					\
241					../libscotch/module.h			\
242					../libscotch/common.h			\
243					$(includedir)/scotch.h			\
244					$(libdir)/libscotch$(LIB)		\
245					$(libdir)/libscotcherrexit$(LIB)	\
246					gcv.h
247
248gmap$(EXE)			:	gmap.c					\
249					../libscotch/module.h			\
250					../libscotch/common.h			\
251					$(includedir)/scotch.h			\
252					$(libdir)/libscotch$(LIB)		\
253					$(libdir)/libscotcherrexit$(LIB)	\
254					gmap.h
255
256gmk_hy$(EXE)			:	gmk_hy.c				\
257					../libscotch/module.h			\
258					../libscotch/common.h			\
259					$(includedir)/scotch.h			\
260					$(libdir)/libscotch$(LIB)		\
261					$(libdir)/libscotcherrexit$(LIB)	\
262					gmk_hy.h
263
264gmk_m2$(EXE)			:	gmk_m2.c				\
265					../libscotch/module.h			\
266					../libscotch/common.h			\
267					$(includedir)/scotch.h			\
268					$(libdir)/libscotch$(LIB)		\
269					$(libdir)/libscotcherrexit$(LIB)	\
270					gmk_m2.h
271
272gmk_m3$(EXE)			:	gmk_m3.c				\
273					../libscotch/module.h			\
274					../libscotch/common.h			\
275					$(includedir)/scotch.h			\
276					$(libdir)/libscotch$(LIB)		\
277					$(libdir)/libscotcherrexit$(LIB)	\
278					gmk_m3.h
279
280gmk_msh$(EXE)			:	gmk_msh.c				\
281					../libscotch/module.h			\
282					../libscotch/common.h			\
283					$(includedir)/scotch.h			\
284					$(libdir)/libscotch$(LIB)		\
285					$(libdir)/libscotcherrexit$(LIB)	\
286					gmk_msh.h
287
288gmk_ub2$(EXE)			:	gmk_ub2.c				\
289					../libscotch/module.h			\
290					../libscotch/common.h			\
291					$(includedir)/scotch.h			\
292					$(libdir)/libscotch$(LIB)		\
293					$(libdir)/libscotcherrexit$(LIB)	\
294					gmk_ub2.h
295
296gmtst$(EXE)			:	gmtst.c					\
297					../libscotch/module.h			\
298					../libscotch/common.h			\
299					$(includedir)/scotch.h			\
300					$(libdir)/libscotch$(LIB)		\
301					$(libdir)/libscotcherrexit$(LIB)	\
302					gmtst.h
303
304gord$(EXE)			:	gord.c					\
305					../libscotch/module.h			\
306					../libscotch/common.h			\
307					$(includedir)/scotch.h			\
308					$(libdir)/libscotch$(LIB)		\
309					$(libdir)/libscotcherrexit$(LIB)	\
310					gord.h
311
312gotst$(EXE)			:	gotst.c					\
313					../libscotch/module.h			\
314					../libscotch/common.h			\
315					$(includedir)/scotch.h			\
316					$(libdir)/libscotch$(LIB)		\
317					$(libdir)/libscotcherrexit$(LIB)	\
318					gotst.h
319
320gout$(EXE)			:	gout_c.c				\
321					gout_o.c				\
322					$(includedir)/scotch.h			\
323					$(libdir)/libscotch$(LIB)
324					$(CC) $(CFLAGS) -I../libscotch -I$(includedir) gout_c.c gout_o.c -o $(@) -L$(libdir) -lscotch -lscotcherrexit $(LDFLAGS)
325
326gpart$(EXE)			:	gmap.c					\
327					../libscotch/module.h			\
328					../libscotch/common.h			\
329					$(includedir)/scotch.h			\
330					$(libdir)/libscotch$(LIB)		\
331					$(libdir)/libscotcherrexit$(LIB)	\
332					gmap.h
333			 		$(CC) $(CFLAGS) -I$(includedir) -I../libscotch $(<) -DSCOTCH_COMPILE_PART -o $(@) -L$(libdir) -lscotch -lscotcherrexit $(LDFLAGS)
334
335gscat$(EXE)			:	gscat.c					\
336					../libscotch/module.h			\
337					../libscotch/common.h			\
338					$(includedir)/scotch.h			\
339					$(libdir)/libscotch$(LIB)		\
340					$(libdir)/libscotcherrexit$(LIB)	\
341					gscat.h
342
343gtst$(EXE)			:	gtst.c					\
344					../libscotch/module.h			\
345					../libscotch/common.h			\
346					$(includedir)/scotch.h			\
347					$(libdir)/libscotch$(LIB)		\
348					$(libdir)/libscotcherrexit$(LIB)	\
349					gtst.h
350
351mcv$(EXE)			:	mcv.c					\
352					../libscotch/module.h			\
353					../libscotch/common.h			\
354					$(includedir)/scotch.h			\
355					$(libdir)/libscotch$(LIB)		\
356					$(libdir)/libscotcherrexit$(LIB)	\
357					mcv.h
358
359mmk_m2$(EXE)			:	mmk_m2.c				\
360					../libscotch/module.h			\
361					../libscotch/common.h			\
362					$(includedir)/scotch.h			\
363					$(libdir)/libscotch$(LIB)		\
364					$(libdir)/libscotcherrexit$(LIB)	\
365					mmk_m2.h
366
367mmk_m3$(EXE)			:	mmk_m3.c				\
368					../libscotch/module.h			\
369					../libscotch/common.h			\
370					$(includedir)/scotch.h			\
371					$(libdir)/libscotch$(LIB)		\
372					$(libdir)/libscotcherrexit$(LIB)	\
373					mmk_m3.h
374
375mord$(EXE)			:	mord.c					\
376					../libscotch/module.h			\
377					../libscotch/common.h			\
378					$(includedir)/scotch.h			\
379					$(libdir)/libscotch$(LIB)		\
380					$(libdir)/libscotcherrexit$(LIB)	\
381					mord.h
382
383mtst$(EXE)			:	mtst.c					\
384					../libscotch/module.h			\
385					../libscotch/common.h			\
386					$(includedir)/scotch.h			\
387					$(libdir)/libscotch$(LIB)		\
388					$(libdir)/libscotcherrexit$(LIB)	\
389					mtst.h
390