source: /cluster/svnroot/bccd-ng/branches/skylar/bccd-3.1.1/packages/etc/skel/CUDA/Makefile @ 3813

Last change on this file since 3813 was 3813, checked in by skylar, 8 years ago

don't set LDFLAGS, it comes from modules (#727)

File size: 1.8 KB
Line 
1# $\Id$
2#
3# This file is part of BCCD, an open-source live CD for computational science
4# education.
5#
6# Copyright (C) 2010 Andrew Fitz Gibbon, Paul Gray, Kevin Hunter, Dave Joiner,
7#   Sam Leeman-Munk, Tom Murphy, Charlie Peck, Skylar Thompson, & Aaron Weeden
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
22CC = nvcc
23CFLAGS = -O2
24ARCH := $(shell uname -m)
25
26ifeq ($(ARCH), i686)
27        CFLAGS += --machine 32
28endif
29
30ifeq ($(ARCH), x86_64)
31        CFLAGS += --machine 64
32endif
33
34ifeq ($(wildcard /etc/bccd-revision),)      # not the BCCD
35  TARGETS = device-query device-query-mpi hello-cuda
36  LDFLAGS =
37else                                        # the BCCD
38  # The combination of MPI and CUDA and icc needs to be reconciled before
39  # device-query-mpi can be built, separate functions into CUDA and not
40  TARGETS = device-query hello-cuda
41endif
42
43all: $(TARGETS)
44
45device-query : device-query-local.c device-query-functions.h
46        $(CC) $(CFLAGS) -o $@ device-query-local.c $(LDFLAGS)
47
48device-query-mpi : device-query-mpi.c device-query-functions.h
49        $(CC) $(CFLAGS) --compiler-bindir='mpicc' -o $@ device-query-mpi.c $(LDFLAGS)
50
51hello-cuda : hello-cuda.cu
52        $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
53
54clean :
55        rm -f device-query hello-cuda device-query-mpi
Note: See TracBrowser for help on using the repository browser.