Commit graph

32 commits

Author SHA1 Message Date
Dirk Hohndel
475e058d40 Make Windows cross compile again
But this is broken as the utf8/utf16 conversions in windows.c are gone
without glib.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06 21:04:25 -07:00
Cristian Ionescu-Idbohrn
09bf866a7e Removed target 'uicables', as it isn't used anywhere.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06 11:20:08 -07:00
Cristian Ionescu-Idbohrn
313ffcd5b4 Distclean might clean the Documentation as well.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06 11:20:07 -07:00
Cristian Ionescu-Idbohrn
159d0883bb Better clean.
Removing both $(HEADERS_NEEDING_MOC:.h=.moc) and qt-ui/*.moc was a
duplication, as all files refered in $(HEADERS_NEEDING_MOC) are located
in directory qt-ui/.

Generated header files qt-ui/ui_*.h were not removed.

Avoid forking `rm' multiple times and regroup file list in a more
intuitive order.

Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06 11:20:04 -07:00
Dirk Hohndel
b3490213f4 Merge branch 'glib-removal-hack'
Fix obvious merge issue in Rules.mk

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06 10:57:16 -07:00
Henrik Brautaset Aronsen
4d0b6e698a Changes to make the glib-removal-hack branch build on MacOSX
Tested with the Homebrew packaging system

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06 10:42:32 -07:00
Lubomir I. Ivanov
92d8978ab4 Rules.mk: call UIC before everything else
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-05 19:52:34 -07:00
Thiago Macieira
5a139c934d Don't include headers under extern "C" unless we have to.
libxml headers include ICU headers and ICU has C++ code. If it detects
__cplusplus, it will start declaring C++ templates and whatnot, which
aren't allowed under extern "C".

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-05 13:59:59 -07:00
Dirk Hohndel
64c6a4278a Install xslt under share on Mac
This is more consistent with Linux and is what's expected with the recent
change to how xslt files are found.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04 13:28:11 -07:00
Thiago Macieira
9035e1b53c Fix build: don't recompile all C++ every time
This was caused by the %.o: %.cpp rule depending on "uicables". Since
it's a phony target, the file never exists, so make will always try to
rebuild it. Regardless of whether anything got run because of that,
the target will then be "newer" than the .o file that was being
considered. Therefore, make thought it had to recompile again.

Fix it by skipping the intermediate, phony target and telling make
that the C++ objects depend directly on the header files.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04 09:54:38 -07:00
Dirk Hohndel
6ae6c768f3 Create the .uic/qt-ui directory
This appears to be missing from commit 565ae2fe89dc ("Ensure that uic is
always run before any C++ source is compiled").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 15:55:45 -07:00
Thiago Macieira
bd1f8b580b Ensure that uic is always run before any C++ source is compiled
It's very, very hard to scan for dependencies with a plain make. So
let's give up and simply enforce that all *.ui files need to be
processed before a *.cpp gets compiled.

This introduces the make target "uicables" (similar to the "mocables"
target that qmake produces) that will compile all .ui files. This
target is now a dependency of all .cpp builds.

In addition, tell make where to find .ui files and their corresponding
ui_*.h files.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 15:45:09 -07:00
Dirk Hohndel
b473604ee8 Update installer so we can cross-build for Windows
Marble doesn't work, yet (Google Maps aren't loaded), but at least
Subsurface starts under Windows with the installer built.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-17 15:05:10 -04:00
Thiago Macieira
f33ba70f8d Create and install the documentation too
The default build will now create the HTML documentation (only the HTML
one) and the install rule will install it.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-31 09:35:40 +09:00
Henrik Brautaset Aronsen
56eaea6993 Enable Marble Google Sat lookup when run as a MacOSX app
Following Dirk's commit ae2c132, add support for custom google sat
data in a MacOSX app bundle

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-30 18:05:02 +09:00
Dirk Hohndel
ae2c132a26 Do a better job finding Marble Google Sat files
First try if Google Sat is already installed as a provider (and just use
it if it is). Then use the executable path to make an educated guess where
these files might be found as part of Subsurface.

We now install the necessary directory tree under
$(DESTDIR)/usr/share/subsurface/marbledata

Still far from perfect - but this should work at least on Linux. MacOS
will need a different modifier for the path and Windows I haven't even
thought about, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-30 14:00:55 +09:00
Thiago Macieira
bb2187ca36 Add the *.ui files, the Makefiles and other headers to subsurface.files
Makes it easier to open them using Ctrl+k in Qt Creator.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-30 12:03:22 +09:00
Dirk Hohndel
f3f7bf51fa Merge branch 'Qt'
After the 3.1 release it is time to shift the focus on the Qt effort - and
the best way to do this is to merge the changes in the Qt branch into
master.

Linus was extremely nice and did a merge for me. I decided to do my own
merge instead (which by accident actually based on a different version of
the Qt branch) and then used his merge to double check what I was doing.

I resolved a few things differently but overall what we did was very much
the same (and I say this with pride since Linus is a professional git
merger)

Here's his merge commit message:

    This is a rough and tumble merge of the Qt branch into 'master',
    trying to sort out the conflicts as best as I could.

    There were two major kinds of conflicts:

     - the Makefile changes, in particular the split of the single
       Makefile into Rules.mk and Configure.mk, along with the obvious Qt
       build changes themselves.

       Those changes conflicted with some of the updates done in mainline
       wrt "release" targets and some helper macros ($(NAME) etc).

       Resolved by largely taking the Qt branch versions, and then editing
       in the most obvious parts of the Makefile updates from mainline.

       NOTE! The script/get_version shell script was made to just fail
       silently on not finding a git repository, which avoided having to
       take some particularly ugly Makefile changes.

     - Various random updates in mainline to support things like dive tags.

       The conflicts were mainly to the gtk GUI parts, which obviously
       looked different afterwards.  I fixed things up to look like the
       newer code, but since the gtk files themselves are actually dead in
       the Qt branch, this is largely irrelevant.

       NOTE! This does *NOT* introduce the equivalent Qt functionality.
       The fields are there in the code now, but there's no Qt UI for the
       whole dive tag stuff etc.

    This seems to compile for me (although I have to force
    "QMAKE=qmake-qt4" on f19), and results in a Linux binary that seems to
    work, but it is otherwise largely untested.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-17 22:01:41 -07:00
Thiago Macieira
aea8493165 Add a make rule (creator-files) that creates files for using Qt Creator
Qt Creator cannot import Subsurface directly because our buildsystem
is not any of the three that it understands (qmake, cmake,
autotools). So, instead, we can create the files Creator uses for
"Other Project" projects.

The files are:
 - subsurface.config:   the #defines from the command line (-D args)
 - subsurface.creator:  an XDG Desktop-style file with Creator settings
 - subsurface.files:    the list of source and header files
 - subsurface.includes: the include paths (-I args)

They are also added to .gitignore, alongside the *.user file that
Creator uses to store per-user settings (editor configuration).

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-09 18:20:34 -07:00
Thiago Macieira
45afd712e8 Add a "distclean" target to make.
Right now, it does the same as confclean

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-09 18:20:01 -07:00
Thiago Macieira
b073823e3a
Clean up the moc intermediates too in make clean
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23 00:06:41 -07:00
Thiago Macieira
d312b7d6fd Don't hardcode the paths for mkdir: just get them from the target
The $(@D) (equivalent to $(dir $@)) tells us what the directory the
target is in. We could also have used the one for the source. They're
equivalent there.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23 00:06:32 -07:00
Thiago Macieira
c5d244eeea Add support for Qt resources in Subsurface
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23 00:06:32 -07:00
Thiago Macieira
17ea074dc0 Prettify the msgfmt and linking arguments
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23 00:06:32 -07:00
Thiago Macieira
f94b6bbefd Make the "silent mode" compilation be optional only.
If you run
   make V=1

Then we'll output the full command-line. It's useful for debugging
problems with the build.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23 00:06:32 -07:00
Thiago Macieira
ce3f073d42 Generate the C++ dependencies at configure-time
We use the -MG preprocessor option to the compiler to ask it to check
all #includes and tell us what's missing. Then our own rules will
generate the moc and uic files that the .cpp #include.

Unfortunately, our rules make uic generate output in qt-ui/ for
qt-ui/*.ui, while the compiler generates rules for no directory. We
need to fake it by forcing the generation.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23 00:06:32 -07:00
Thiago Macieira
a0b523a5af Get the list of dependency includes from the SOURCES list
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23 00:06:32 -07:00
Thiago Macieira
d773c02bf3 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>
2013-04-23 00:06:32 -07:00
Thiago Macieira
c8b360c3b5 Add a HEADERS variable to the Makefile
Similar to the qmake variable of the same name, this lists (at least)
the headers that may need moc to be run on. Adding more headers is not
a problem.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23 00:06:32 -07:00
Thiago Macieira
c11ce7e157 Introduce a cache of the configuration
You may have noticed that running make is a little slow. Every time
that it is loaded, it will try to detect everything again. So,
instead, save the output and reload it the next time.

This is implemented by adding a rule that (re-)creates the
config.cache file, which is included by make. If the file doesn't
exist yet, make will first run the rule which creates it, then reload
itself.

You can also cause it to reconfigure by running "make configure".

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23 00:06:32 -07:00
Thiago Macieira
d47b904580 Trim Makefile, Configure.mk and Rules.mk
Configure.mk contains the detection rules, whereas Rules.mk contains
the rules to actually build Subsurface. This simplifies Makefile
greatly, which is the file that should be actually modified during
regular updates to the codebase.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-04-23 00:06:32 -07:00
Thiago Macieira
f6d133f387 Create Rules.mk and Configure.mk by copying the Makefile
This is to help Git know that the two files are the same content as
the Makefile. The next commit will trim the files to what they need to
be.
2013-04-23 00:06:32 -07:00