*******高分************/谁能帮我写个makefile
是这样的,我做的程序需要联接两个库,一个是ltilib,现在想用wx-GTK-2.4.1作个界面.我用ltilib的时候是用他给的makefile.
#----------------------------------------------------------------
# project ....: LTI Digital Image/Signal Processing Library
# file .......: Template Makefile for Examples
# authors ....: Pablo Alvarado, Jochen Wickel
# organization: LTI, RWTH Aachen
# creation ...: 09.02.2003
# revisions ..: $Id: Makefile.in,v 1.5 2003/06/02 06:34:16 alvarado Exp $
#----------------------------------------------------------------
#Base Directory
LTIBASE:=../..
LTICMD:=$(LTIBASE)/linux/lti-local-config
#Example name
PACKAGE:=$(shell basename $$PWD)
# If you want to generate a debug version, uncomment the next line
BUILDRELEASE=yes
# Compiler to be used
CC:=g++
# For new versions of gcc, <limits> already exists, but in older
# versions a replacement is needed
CC_MAJOR:=$(shell echo `$(CC) --version | sed -e 's/\..*//;'`)
ifeq "$(CC_MAJOR)" "2"
VPATHADDON=:../../linux/g++
CPUARCH:=-march=i686 -mcpu=i686
else
VPATHADDON=
CPUARCH:=-march=pentium4 -mcpu=pentium4
endif
# Directories with source file code (.h and .cpp)
VPATH:=$(VPATHADDON)
# Destination directories for the debug and release versions of the code
OBJDIR = ./
# Extra include directories and library directories for hardware specific stuff
EXTRAINCLUDEPATH =
EXTRALIBPATH =
EXTRALIBS =
#EXTRAINCLUDEPATH = -I/usr/src/menable/include
#EXTRALIBPATH = -L/usr/src/menable/lib
#EXTRALIBS = -lpulnixchanneltmc6700 -lmenable
# PROFILE = -p
PROFILE=
# compiler flags
CXXINCLUDE:=$(EXTRAINCLUDEPATH) $(patsubst %,-I%,$(subst :, ,$(VPATH)))
LINKDIR:=-L$(LTIBASE)/lib
CPPFILES=$(wildcard ./*.cpp)
OBJFILES=$(patsubst %.cpp,$(OBJDIR)%.o,$(notdir $(CPPFILES)))
# set the compiler/linker flags depending on the debug/release flag
ifeq "$(BUILDRELEASE)" "yes"
LTICXXFLAGS:=$(shell $(LTICMD) --cxxflags)
CXXFLAGSREL:=-c -O3 $(CPUARCH) -Wall -ansi $(LTICXXFLAGS) $(CXXINCLUDE)
GCC:=$(CC) $(CXXFLAGSREL) $(PROFILE)
LIBS:=$(shell $(LTICMD) --libs) $(EXTRALIBS)
else
LTICXXFLAGS:=$(shell $(LTICMD) --cxxflags debug)
CXXFLAGSDEB:=-c -g $(CPUARCH) -Wall -ansi $(LTICXXFLAGS) $(CXXINCLUDE)
GCC:=$(CC) $(CXXFLAGSDEB) $(PROFILE)
LIBS:=$(shell $(LTICMD) --libs debug) $(EXTRALIBS)
endif
LNALL = $(CC) $(PROFILE)
# implicit rules
$(OBJDIR)%.o : %.cpp
@echo "Compiling $<..."
@$(GCC) $< -o $@
all: $(PACKAGE)
# example
$(PACKAGE): $(OBJFILES)
@echo "Linking $(PACKAGE)..."
@$(LNALL) -o $(PACKAGE) $(OBJFILES) $(LIBS)
clean:
@echo "Removing *.o files..."
@rm -f *.o
@echo "Ready."
clean-all:
@echo "Removing files..."
@echo " removing obj, core and binary files..."
@rm -f ./core* $(PACKAGE) $(OBJDIR)*.o
@echo " removing emacs backup files..."
@find $$PWD \( -name '*\~' -or -name '\#*' \) -exec rm -f {} \;
@echo " removing other automatic created backup files..."
@find $$PWD \( -name '\.\#*' -or -name '\#*' \) -exec rm -f {} \;
@rm -fv nohup.out
@echo "Ready."
debug:
@echo "Package: $(PACKAGE)"
# you can change this target, if you don't want the general make file
# to replace this makefile
Makefile: ../template/Makefile
@echo "Getting template/Makefile..."
@cp -v ../template/Makefile .
我要是想多连一个wxGtk库的话,怎么改讷.我看不大懂这个makefile.
编译另一个库的makefile
#
# File: Makefile for samples
# Author: Robert Roebling
# Created: 1999
# Updated:
# Copyright: (c) 1998 Robert Roebling
#
# This makefile requires a Unix version of wxWindows
# to be installed on your system. This is most often
# done typing "make install" when using the complete
# sources of wxWindows or by installing the two
# RPM packages wxGTK.XXX.rpm and wxGTK-devel.XXX.rpm
# under Linux.
#
CXX = $(shell wx-config --cxx)
PROGRAM = pngdemo
OBJECTS = $(PROGRAM).o
# implementation
.SUFFIXES: .o .cpp
.cpp.o :
$(CXX) -c `wx-config --cxxflags` -o $@ $<
all: $(PROGRAM)
$(PROGRAM): $(OBJECTS)
$(CXX) -o $(PROGRAM) $(OBJECTS) `wx-config --libs`
clean:
rm -f *.o $(PROGRAM)
一大堆,完全看不懂.
请教哪位高手帮我写一个makefile能连这两个库.