File: Makefile

package info (click to toggle)
yudit 2.9.6-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 13,868 kB
  • sloc: cpp: 70,516; perl: 4,299; ansic: 1,957; makefile: 846; sh: 331
file content (102 lines) | stat: -rw-r--r-- 2,467 bytes parent folder | download | duplicates (3)
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
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=$(wildcard locale/*)

ifeq ($(SPLATFORM),WINDOWS)
TARGET=gui.lib
OBJS=$(subst .o,.obj,$(TARGETOBJS))
MAINOBJS=$(subst .o,.obj,$(MAINOBJ))
SLIBS=/libpath:../stoolkit stoolkit.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
SWINLIBS=-L../swindow -lswindow 
SWIDGETLIBS=-L../swidget -lswidget 
SGUILIBS=-L../gui -lgui 
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)/$(datadir)/$$i/LC_MESSAGES; then \
			mkdir -p $(DESTDIR)/$(datadir)/$$i/LC_MESSAGES; \
		fi ; \
		$(INSTALL_DATA) $$i/LC_MESSAGES/messages.mo \
			$(DESTDIR)/$(datadir)/$$i/LC_MESSAGES/yudit.mo ; \
		echo installing messages for $$i; \
	done
	rm -f $(DESTDIR)/$(bindir)/yudit
	$(INSTALL_PROGRAM) $(MAIN) $(DESTDIR)/$(bindir)

messages:
	@if [ $(MSGMERGE) != ":" ] ; then \
		echo "start translating  messages"; \
		xgettext --c++ --keyword=translate  ../swidget/*.cpp *.cpp; \
		for i in $(LOCALES); do \
			echo $$i/LC_MESSAGES/messages.po ; \
			cd $$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 yudit.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