Quanta > Makefile
Home
News
Download
History
Papers
Bugs
Contact
Documentation

A simple Makefile to compile new programs with QUANTA (UNIX version)

#######################################################################
# Here is a sample Makefile which compiles and links a program test.cxx and uses the
# QUANTA library.
########################################################################

######################################################################
# Step 1 : Decide the binary type that you are using
# So QUANTA_BIN_TYPE can be given 32, n32 or 64 (check which type your platform supports)
#######################################################################

QUANTA_BIN_TYPE=n32
QUANTA_THREAD_TYPE=pthreads

#######################################################################
# Step 2: Include the location of the file QUANTA_APPLICATION_INCLUDES
# in this example /usr/local is the installation directory
#######################################################################

include /usr/local/include/QUANTA/QUANTA_APPLICATION_INCLUDES

#######################################################################
# Step 3: Define the include directory path and library path as shown below.
# Use $(QUANTA_CFLAGS) when you compile your source code and $(QUANTA_LIB)
# when you want to create an exceutable
#######################################################################

INCLUDE_DIR       = -I/usr/local/include
LIBRARY_DIR       = -L/usr/local/lib
LIBRARIES         = $(QUANTA_LIB) -lpthread
COMPILER_FLAGS    = -O $(QUANTA_CFLAGS)
COMPILER          = $(CPPCOMPILER)
OBJ_FILES	  = test.o
EXEC		  = test
$(EXEC):	$(OBJ_FILES)
		$(COMPILER) $(COMPILER_FLAGS) -o $(EXEC) $(OBJ_FILES)\
			$(LIBRARY_DIR) $(LIBRARIES)
test.o: test.cxx
	  	$(COMPILER) $(COMPILER_FLAGS) $(INCLUDE_DIR) -c test.cxx
clean:
	  	\rm -f $(OBJ_FILES) $(EXEC)