Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/lamont/src/lib/build/mk/build_gmk.in
ViewVC logotype

View of /branches/lamont/src/lib/build/mk/build_gmk.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1725 - (download) (annotate)
Mon Mar 12 21:18:01 2012 UTC (7 years, 5 months ago) by jhr
Original Path: branches/vis12/src/lib/build/mk/build_gmk.in
File size: 1763 byte(s)
  Working on library support; made iso2d-polyline into a library test case
# build.gmk
#
# COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
# All rights reserved.
#
# Common definitions shared by all of the runtime-system makefiles.
#
# @configure_input@
#

#
# determine the build options
#
ifeq (,$(findstring debug,$(BUILD_OPTIONS)))
  ENABLE_DEBUG=false
else
  ENABLE_DEBUG=true
endif
ifeq (,$(findstring float,$(BUILD_OPTIONS)))
  PRECISION=double
else
  PRECISION=float
endif
ifeq (,$(findstring parallel,$(BUILD_OPTIONS)))
  ENABLE_PARALLEL=false
else
  ENABLE_PARALLEL=true
endif

#
# tools and flags
#
CC =		@CC@
INCLUDES =	-I@DIDEROT_SRCDIR@/include -I@TEEM_DIR@/include -I../../include
CFLAGS =	@CFLAGS@ @CFLAG_M64@
LDFLAGS =
CPPFLAGS =	@CPPFLAGS@ $(INCLUDES)

COMMON_SRCS =	image.c input.c eigen2x2.c eigen3x3.c

SRCS		= $(COMMON_SRCS) $(TARGET_SRCS)
OBJS		= $(patsubst %.c,%.o,$(SRCS))

#
# determine target platform
#
ifeq (c,$(TARGET_PLATFORM))
  CPPFLAGS += -DDIDEROT_TARGET_C
else ifeq (cl,$(TARGET_PLATFORM))
  CPPFLAGS += -DDIDEROT_TARGET_CL
else ifeq (cuda,$(TARGET_PLATFORM))
  CPPFLAGS += -DDIDEROT_TARGET_CUDA
else ifeq (parallel,$(TARGET_PLATFORM))
  CPPFLAGS += -DDIDEROT_TARGET_PARALLEL
endif

#
# set debug flags, if needed
#
ifeq ($(ENABLE_DEBUG),true)
  CFLAGS += -g3 -O0
else
  CPPFLAGS += -DNDEBUG
  CFLAGS += -O3
endif

#
# set numeric precision
#
ifeq ($(PRECISION),float)
  CPPFLAGS += -DDIDEROT_SINGLE_PRECISION
else
  CPPFLAGS += -DDIDEROT_DOUBLE_PRECISION
endif
CPPFLAGS += -DDIDEROT_INT

ifeq ($(ENABLE_PARALLEL),true)
  CFLAGS += @PTHREAD_CFLAGS@
endif

$(TARGET):	$(OBJS)
	$(LD) -r -o $(TARGET) $(OBJS)

#################### Cleanup ####################

CLEAN_FILES = 		$(OBJS) $(TARGET)
CLEAN_FILES += 		$(wildcard *.dSYM)

include @DIDEROT_MKDIR@/clean-rules.gmk

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0