tmake

ftp://trolltech.com/freebies/tmake から 1.8 の tarball を入手してインストール。
とりあえず ~/bin の下に置く。

~/bin/tmake-1.8/bin

.tcshrc に追加

setenv TMAKEPATH  ${HOME}/bin/tmake-1.8/lib/freebsd-g++
setenv PATH       ${PATH}:${HOME}/bin/tmake-1.8/bin

確認。

>tmake
Usage:
    tmake [options] project-files
Options:
    -e expr    Evaluate expression, ignore template file
    -nodepend  Don't generate dependency information
    -o file    Write output to file
    -t file    Specify a template file
    -unix      Create output for Unix (auto detects)
    -v         Verbose/debug mode
    -win32     Create output for Win32 (auto detects)

オッケー見たい。progen も試す。

>progen --help
Usage:
    progen [options] [files]
Options:
    -lower   Lower-case letters filenames (useful for non-Unix)
    -n name  Specify a project name (= TARGET)
    -o file  Write output to "file"
    -t file  Specify a template file other than qtapp
    -d directory Search for files in specified directory and subdirectories

大丈夫っぽい。
example の Makefile を作って見る。
.pro ファイルが既にあるので rename して progen から試す。

>cd ~/bin/tmake-1.8/example/
>mv hello.pro hello.pro.org
>progen -n hello -o hello.pro

.pro を diff ってみる。

>diff hello.pro.org hello.pro

これが何か?

5a6
> INTERFACES	= 

とりあえず無視して Makefile を作って見る。

>tmake -o Makefile hello.pro

できあがった Makefile はこれ。

#############################################################################
# Makefile for building hello
# Generated by tmake at 15:43, 2005/01/22
#     Project: hello
#    Template: app
#############################################################################

####### Compiler, tools and options

CC	=	gcc
CXX	=	g++
CFLAGS	=	-pipe -fno-exceptions -Wall -W -O2 -DNO_DEBUG
CXXFLAGS=	-pipe -fno-exceptions -Wall -W -O2 -DNO_DEBUG
INCPATH	=	-I/usr/local/include -I$(QTDIR)/include
LINK	=	g++
LFLAGS	=	
LIBS	=	$(SUBLIBS) -L/usr/local/lib -L$(QTDIR)/lib -L/usr/X11R6/lib -lqt -lXext -lX11 -lm
MOC	=	$(QTDIR)/bin/moc
UIC	=	$(QTDIR)/bin/uic

TAR	=	tar -cf
GZIP	=	gzip -9f

####### Files

HEADERS =	hello.h
SOURCES =	hello.cpp \
		main.cpp
OBJECTS =	hello.o \
		main.o
INTERFACES =	
UICDECLS =	
UICIMPLS =	
SRCMOC	=	moc_hello.cpp
OBJMOC	=	moc_hello.o
DIST	=	
TARGET	=	hello
INTERFACE_DECL_PATH = .

####### Implicit rules

.SUFFIXES: .cpp .cxx .cc .C .c

.cpp.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cxx.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cc.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.C.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.c.o:
	$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<

####### Build rules


all: $(TARGET)

$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) 
	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)

moc: $(SRCMOC)

tmake: Makefile

Makefile: hello.pro
	tmake hello.pro -o Makefile

dist:
	$(TAR) hello.tar hello.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST)
	$(GZIP) hello.tar

clean:
	-rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET)
	-rm -f *~ core

####### Sub-libraries


###### Combined headers


####### Compile

hello.o: hello.cpp \
		hello.h

main.o: main.cpp \
		hello.h

moc_hello.o: moc_hello.cpp \
		hello.h

moc_hello.cpp: hello.h
	$(MOC) hello.h -o moc_hello.cpp

行けるっぽい。