Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
88 lines (64 sloc) 2.33 KB
SUFFIXES = .rb .ui .cc .hh
QTDIR = /Users/janwedekind/QtSDK/Desktop/Qt/474/gcc
CXXOPTS = -I$(QTDIR)/include
LDADD = -L$(QTDIR)/lib -F$(QTDIR)/lib -framework QtGui -framework QtSvg -framework QtCore
RUBY = ruby
RBUIC = rbuic4
RBRCC = rbrcc
UIC = $(QTDIR)/bin/uic
MOC = $(QTDIR)/bin/moc
RCC = $(QTDIR)/bin/rcc
TAR = tar
MKDIR = mkdir
CP = cp
INSTALL_NAME_TOOL = install_name_tool
RUBYUI = ui_gamewindow.rb ui_content.rb qrc_battleship.rb
CCUI = ui_gamewindow.hh ui_content.hh
OBJECTS = battleship.o gamewindow.o game.o boardview.o content.o player.o
MOC_OBJECTS = moc_gamewindow.o moc_boardview.o moc_content.o
RCCOBJ = qrc_battleship.o
SOURCES = battleship.cc boardview.cc content.cc game.cc gamewindow.cc player.cc \
boardview.hh content.hh game.hh gamewindow.hh player.hh \
battleship.rb boardview.rb content.rb game.rb gamewindow.rb player.rb tc_battleship.rb \
content.ui gamewindow.ui battleship.qrc \
battleship.svg carrier.svg destroyer.svg hit.svg miss.svg panel.svg patrol\ boat.svg \
submarine.svg \
Makefile Makefile.mingw Makefile.macos
default: cpp
all: cpp ruby
cpp: battleship
dist: battleship.tar.bz2
battleship.tar.bz2: $(SOURCES)
$(MKDIR) battleship
$(CP) $(SOURCES) battleship
$(TAR) cjf battleship.tar.bz2 battleship
rm -Rf battleship
battleship: $(CCUI) $(OBJECTS) $(MOC_OBJECTS) $(RCCOBJ)
$(CXX) -o $@ $(OBJECTS) $(MOC_OBJECTS) $(RCCOBJ) $(LDADD)
$(INSTALL_NAME_TOOL) -change $(QTDIR)/lib/QtGui.framework/Versions/4/QtGui @executable_path/QtGui.framework/QtGui $@
$(INSTALL_NAME_TOOL) -change $(QTDIR)/lib/QtSvg.framework/Versions/4/QtSvg @executable_path/QtSvg.framework/QtSvg $@
$(INSTALL_NAME_TOOL) -change $(QTDIR)/lib/QtCore.framework/Versions/4/QtCore @executable_path/QtCore.framework/QtCore $@
ruby: $(RUBYUI)
test:
$(RUBY) tc_battleship.rb
clean:
rm -Rf ui_*.rb qrc_*.rb ui_*.hh qrc_*.cc moc_*.cc *.o *~ .deps battleship
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
.cc.o:
$(CXX) -Wp,-MD,.deps/$(*F).pp -c $< -o $@ $(CXXOPTS)
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
ui_%.rb: %.ui
$(RBUIC) $< > $@
ui_%.hh: %.ui
$(UIC) $< > $@
moc_%.cc: %.hh
$(MOC) $< > $@
qrc_%.rb: %.qrc
$(RBRCC) $< > $@
qrc_%.cc: %.qrc
$(RCC) $< > $@
-include $(wildcard .deps/*.P) :-)