torc/Makefile.user

99 lines
2.7 KiB
Makefile

# Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
# $HeadURL$
# $Id$
# This program is free software: you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with this program. If
# not, see <http://www.gnu.org/licenses/>.
# Instructions:
# 1. Define SRC_DIR as an environment variable, or set SRC_DIR in this file as a path to the
# torc/trunk/src directory.
# 2. Define the USER_EXAMPLE_EXEC variable in this file to be the name of your executable.
# 3. Define the USER_EXAMPLE_OBJS variable in this file to be the list of object files for your
# program. The Torc object files will be included through the TORC_REAL_OBJS_FILE variable.
# 4. Create your user example source code, including a main() function.
# 5. Invoke 'make' to build the Torc objects as well as your user executable.
SRC_DIR = /path-to/torc/trunk/src
TORC_DIR = $(SRC_DIR)/torc
-include $(SRC_DIR)/Makefile.local
include $(TORC_DIR)/Makefile.objects
# LDFLAGS
LDFLAGS = \
-m64 \
-L/usr/local/lib \
-dead_strip \
$(BOOST_LIB_DIR_OPTION) \
-lboost_filesystem \
-lboost_regex \
-lboost_signals \
-lboost_system \
-lboost_thread \
-lstdc++ \
-lm \
$
# User Example Objects
USER_EXAMPLE_EXEC := UserExample
USER_EXAMPLE_OBJS := UserExample.o
# Local objects
OBJS = \
$(USER_EXAMPLE_OBJS) \
$
# Torc Real Objects File
TORC_REAL_OBJS_FILE = TorcRealObjects
# Local dependencies
DEPS = $(OBJS:.o=.d)
.PHONY: all
# Make everything by default
all: \
$(USER_EXAMPLE_EXEC) \
$
# Dependency Include
ifneq ($(MAKECMDGOALS), clean)
ifneq ($(MAKECMDGOALS), clean_torc)
-include $(DEPS)
-include $(TORC_DEPS)
endif
endif
# Create torc real objects file
$(TORC_REAL_OBJS_FILE): $(TORC_REAL_OBJS)
@echo $(TORC_REAL_OBJS) > $(TORC_REAL_OBJS_FILE)
# make the user example executable
$(USER_EXAMPLE_EXEC): $(TORC_REAL_OBJS_FILE) $(USER_EXAMPLE_OBJS)
$(CC) \
@$(TORC_REAL_OBJS_FILE) \
$(USER_EXAMPLE_OBJS) \
$(CCFLAGS) \
$(LDFLAGS) \
-o $@
# clean everything (builds on Makefile.targets clean)
clean::
rm -f $(USER_EXAMPLE_EXEC)
rm -f $(TORC_REAL_OBJS_FILE)
# Clean Torc Objects / Dependencies
clean_torc:
rm -f $(TORC_REAL_OBJS_FILE) $(TORC_REAL_OBJS) $(TORC_DEPS)
# Include Makefile.targets
include $(TORC_DIR)/Makefile.targets