summaryrefslogtreecommitdiff
path: root/muse2/common.am
blob: 919f85939678c2d8ec8ad21f630cb264fffdd86d (plain)
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
AM_CXXFLAGS = $(MUSECXXFLAGS) -I.. -I$(top_srcdir)/synti -I$(top_srcdir)/muse/widgets
AM_CXXFLAGS += -DQT_SHARED -DQT_THREAD_SUPPORT -DQT_PLUGIN $(QTDIR_INC) -DQT3_SUPPORT
AM_CPPFLAGS =
MOC = $(QTDIR_BIN)/moc
#UIC = $(QTDIR_BIN)/uic3
UIC = /usr/bin/uic3

UIFILES = $(wildcard *.ui)

MOCFILES = $(shell for h in $(filter %.h,$(SOURCES)); do \
		     if grep -q Q_OBJECT $$h; then \
		       echo $$h | sed "s/\(.*\)\.h/moc_\1.cpp/"; \
		     fi; \
		   done)

BUILT_SOURCES = $(MOCFILES) $(UIFILES:%.ui=%.h)

MOSTLYCLEANFILES = $(MOCFILES) $(UIFILES:%.ui=%.h)

de:
	@for base in $(MOCFILES); do echo -e "\t$${base}.cpp $${base}.h \\"; done

nde:
	@for base in $(MOCFILES); do echo -e "\tmoc_$${base}.cpp \\"; done

SUFFIXES = .ui .h.gch

.ui.o: %.h
	$(UIC) -L $(top_srcdir)/muse/widgets -o $*.cpp -impl $*.h $*.ui
	$(MOC) $*.h >> $*.cpp
	$(CXXCOMPILE) -c $*.cpp -o $*.o
	$(RM) $*.cpp moc_$*.cpp moc_$*.o

.ui.lo: %.h
	$(UIC) -L $(top_srcdir)/muse/widgets -o $*.cpp -impl $*.h $*.ui
	$(MOC) $*.h >> $*.cpp
	$(LTCXXCOMPILE) -c $*.cpp -o $*.lo
	$(RM) $*.cpp moc_$*.cpp moc_$*.lo moc_$*.o


moc_%.cpp: %.h
	$(MOC) $< -o $@

%.h: %.ui
	$(UIC)  -o $@ $<
#	$(UIC) -L $(top_srcdir)/muse/widgets -o $@ $<