1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
include ../Makefile.conf
TARGETOBJS=SYudit.o SToolBar.o SMessageBar.o SMessageLabel.o \
SKMapPanel.o SKMapDialog.o SHighlightD.o
TARGETDIR=
MAINOBJ=Main.o
MAIN=yudit
LOCALES=$(subst locale/,,$(wildcard locale/*))
ifeq ($(SPLATFORM),WINDOWS)
TARGET=gui.lib
OBJS=$(subst .o,.obj,$(TARGETOBJS))
MAINOBJS=$(subst .o,.obj,$(MAINOBJ))
SLIBS=/libpath:../stoolkit stoolkit.lib /libpath:../addon addon.lib
SWINLIBS=/libpath:../swindow swindow.lib
SWIDGETLIBS=/libpath:../swidget swidget.lib
SGUILIBS=/libpath:../gui /subsystem:WINDOWS gui.lib
MYLIBS=/link /subsystem:WINDOWS $(SGUILIBS) $(SWIDGETLIBS) $(SWINLIBS) $(SLIBS) $(SWINDOW_LIBS) $(ALL_LIBS)
RESOURCE=yudit.res
else
TARGET=libgui.a
OBJS=$(TARGETOBJS)
MAINOBJS=$(MAINOBJ)
SLIBS=-L../stoolkit -lstoolkit -L../addon -laddon
SWIDGETLIBS=-L../swidget -lswidget
SGUILIBS=-L../gui -lgui
ifeq ($(SWINDOWS),OSX)
SWINLIBS=-L../swindow -lswindow -Wl,-framework,Cocoa
else
SWINLIBS=-L../swindow -lswindow
endif
MYLIBS=$(SGUILIBS) $(SWIDGETLIBS) $(SWINLIBS) $(SLIBS) $(ALL_LIBS)
RESOURCE=
endif
.PHONY: messages
all: $(TARGET) $(MAIN)
$(MAIN): $(TARGET) $(MAINOBJS) $(RESOURCE)
$(LD) -o yudit $(MAINOBJS) $(RESOURCE) $(MYLIBS)
#
# This is a windows thing
#
yudit.res:
rc /Fo $@ yudit.rc
gui.lib: $(OBJS)
$(AR)$@ $(subst swin32/,,$(OBJS))
libgui.a: $(OBJS)
$(AR) $@ $(OBJS)
$(RANLIB) $@
%.o:%.cpp
$(CXX) -c $(CPPFLAGS) $(subst .o,.cpp,$@)
%.obj:%.cpp
$(CXX) -c $(CPPFLAGS) $(subst .obj,.cpp,$@)
depend:
$(CXX) -M $(CPPFLAGS) $(patsubst %.o,%.cpp,$(OBJS)) > .depend
install:
@for i in $(LOCALES); do \
if test ! -d $(DESTDIR)/$(localedir)/$$i/LC_MESSAGES; then \
mkdir -p $(DESTDIR)/$(localedir)/$$i/LC_MESSAGES; \
fi ; \
$(INSTALL_DATA) locale/$$i/LC_MESSAGES/messages.mo \
$(DESTDIR)/$(localedir)/$$i/LC_MESSAGES/yudit.mo ; \
echo installing messages for $$i; \
done
@rm -f $(DESTDIR)/$(bindir)/yudit
$(INSTALL_PROGRAM) $(MAIN) $(DESTDIR)/$(bindir)
$(INSTALL_DATA) yudit.1 $(DESTDIR)/$(mandir)/man1
messages:
@if [ $(MSGMERGE) != ":" ] ; then \
echo "start translating messages"; \
xgettext --c++ --keyword=translate ../swidget/*.cpp *.cpp; \
sed -i 's/charset=CHARSET/charset=UTF-8/g' messages.po; \
for i in $(LOCALES); do \
echo locale/$$i/LC_MESSAGES/messages.po ; \
cd locale/$$i/LC_MESSAGES ; touch messages.po; \
$(MSGMERGE) --width=100 --strict \
messages.po ../../../messages.po > messages.pod; \
if [ $$? != 0 ]; then \
cd ../../..; \
exit 1; \
fi; \
mv messages.pod messages.po; \
msgfmt -o messages.mo messages.po; \
cd ../../..; \
done ; \
echo "end translating messages" ; \
fi
clean:
rm -f *.o *.obj *.o *.exe $(TARGET) $(MAIN)
ifeq (.depend, $(wildcard .depend))
include .depend
endif
|