[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: makefile for c++ programs.
From: |
fiik |
Subject: |
Re: makefile for c++ programs. |
Date: |
Thu, 28 Jul 2005 13:20:18 +1000 |
User-agent: |
KNode/0.8.2 |
Think of using CMake available from www.cmake.org - it is a free
cross-platform makefile generator. It will look at your system and
automatically include the required files and libraries.
Amit Bhatia wrote:
> Hello,
> I am sorry to be posting this to this grp as I could not find any
> group for such queries in mac based forums.
> I am using os 10.3.
> I wish to make a Makefile for compiling c++ programs. I use simple
> emacs interface for writing all the code and terminal to compile them. I
> have used a Makefile on linux systems for the same. just wondering how
> to change it: many of the things would be changed or would be in
> different locations.
>
> any suggestions? do people normally use configure or something to make
> these makefiles?
>
> for linux(RH 9.0) my makefile looked like:
>
>
> # This file was generated automatically by configure. Do not edit.
> VPATH = .
> #
> # Makefile
> #
> RDEV_ROOT =/home/code
> #### package, host, target, and site dependent Makefile fragments come
> in here.
> #-----------------------------#
> # Package fragment for LPSOLVE#
> #-----------------------------#
> LPSOLVE_ROOT = $(RDEV_ROOT)/Packages/lp_solve_4.0
> LPSOLVE_INCL = -I$(LPSOLVE_ROOT)
> LPSOLVE_DEFS =
> LPSOLVE_BUILD = -L$(LPSOLVE_ROOT)
> LPSOLVE_ARCHIVE = $(LPSOLVE_ROOT)/liblpk.a
>
> CC = gcc
> CFLAGS = -c -g -fwritable-strings -static -ansi -pedantic
>
> G = g++
> CXX = g++
> #CXXFLAGS = -c -g -fwritable-strings -Wno-deprecated -static -ansi
> -pedantic
> CXXFLAGS = -c -pg -O -Wno-deprecated -ansi -pedantic
> DEPENDSFLAG = -M -Wno-deprecated
> CXXLINKFLAGS = -pg -O -Wno-deprecated -ansi -pedantic
>
> LD = g++
> LDFLAGS =
>
> #DLFLAGS= -Wl,-rpath,$(XERCES_ROOT)/lib
> -Wl,-rpath,$(OPTPP_ROOT)/tests/xml -Wl,-export-dynamic
> DLLIBS = -ldl -lpthread
>
> SOFLAGS = -g -fwritable-strings -Wno-deprecated -ansi -pedantic
> -fPIC -shared
>
> AR = ar ruv
> RANLIB = ranlib
>
> ARCH = IX86
> ARCH_DEFINES = -DANSI_HEADERS -D_G_HAVE_BOOL
> ARCH_INCLUDES =
> ARCH_LIBS = -lm
>
> #---------------------------------------#
> # Host OS-dependent definitions - LINUX #
> #---------------------------------------#
>
> AWK = awk
> CAT = cat -s
> CD = cd
> CHMOD = chmod 664
> CP = cp -p
> ECHO = /bin/echo
> EGREP = egrep
> FGREP = fgrep -v
> GREP = grep -s
> LN = ln -s
> LS = ls -lF
> MAKE = make
> MKDIR = mkdir -m 775
> MV = mv
> RM = rm -f
> SED = sed -e
> SHELL = /bin/sh
> SLEEP = sleep
> TAR_CPY = tar -cvf
> TAR_LST = tar -tvf
> TAR_XTR = tar -xvf
> TOUCH = touch -m
>
>
>
> thanks,
> amit.