aboutsummaryrefslogtreecommitdiffstats
path: root/Rules.mk
diff options
context:
space:
mode:
authorGravatar Thiago Macieira <thiago@macieira.org>2013-04-13 09:27:55 -0700
committerGravatar Thiago Macieira <thiago@macieira.org>2013-04-23 00:06:32 -0700
commitd773c02bf36f3b09584123bfd0e84a56304b33fb (patch)
treef12c88fbca226040fafb8e9b44c708e748d82aef /Rules.mk
parentc8b360c3b5fdeb9f878cb5db648a121a10e33772 (diff)
downloadsubsurface-d773c02bf36f3b09584123bfd0e84a56304b33fb.tar.gz
Add a SOURCES variable to the Makefile, replacing OBJS
Instead of listing objects, let's list sources. This matches also what qmake and most other buildsystems do. The notable exception is the kernel. The reason that listing the sources will be interesting is because I'm about to add rules to create the dependency files. Signed-off-by: Thiago Macieira <thiago@macieira.org>
Diffstat (limited to 'Rules.mk')
-rw-r--r--Rules.mk5
1 files changed, 5 insertions, 0 deletions
diff --git a/Rules.mk b/Rules.mk
index 8ffb88b86..e7108fd4b 100644
--- a/Rules.mk
+++ b/Rules.mk
@@ -19,6 +19,11 @@ PRODVERSION_STRING := $(shell $(GET_VERSION) win $(VERSION_STRING) || \
MSGOBJS=$(addprefix share/locale/,$(MSGLANGS:.po=.UTF-8/LC_MESSAGES/subsurface.mo))
+C_SOURCES = $(filter %.c, $(SOURCES))
+CXX_SOURCES = $(filter %.cpp, $(SOURCES))
+OTHER_SOURCES = $(filter-out %.c %.cpp, $(SOURCES))
+OBJS = $(C_SOURCES:.c=.o) $(CXX_SOURCES:.cpp=.o) $(OTHER_SOURCES)
+
# Add the objects for the header files which define QObject subclasses
HEADERS_NEEDING_MOC += $(shell grep -l -s 'Q_OBJECT' $(HEADERS))
MOC_OBJS = $(HEADERS_NEEDING_MOC:.h=.moc.o)