Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 13 additions & 44 deletions win32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ nxjsondir = $(gpreddir)/nxjson

# tools
CC = gcc -Wall -O2 -mms-bitfields -DWIN32
AS = as
DLLWRAP = dllwrap
DLLWRAP_FLAGS = --as=$(AS) --export-all --driver-name $(CC) -s
RC = windres
# NB: .rc file create various version formats from the numbers
RCFLAGS = --define __WIN32__ --define __WIN95__ --define MSRC --define __GNUWIN32__ \
Expand All @@ -27,14 +24,12 @@ RCFLAGS = --define __WIN32__ --define __WIN95__ --define MSRC --define __GNUWIN3
# libraries
GTKLIBS := $(shell pkg-config --define-prefix --libs gtk+-3.0)
GLIBLIB := $(shell pkg-config --define-prefix --libs glib-2.0 gthread-2.0)
GOOLIBS := $(shell pkg-config --define-prefix --libs goocanvas-3.0)
GUI_LIBS = $(GTKLIBS) $(GLIBLIB) $(GOOLIBS) libsgpsdp.lib -lwinmm -lwininet -lws2_32
GUI_LIBS = $(GTKLIBS) $(GLIBLIB) libsgpsdp.lib -lwinmm -lwininet -lws2_32
LIBS = -lm

# flags/defines
GTK_CFLAGS := $(shell pkg-config --define-prefix --cflags gtk+-3.0)
GOO_CFLAGS := $(shell pkg-config --define-prefix --cflags goocanvas-3.0)
CFLAGS = -DVERSION_SHORT=$(VERSION_SHORT) -DHAVE_CONFIG_H -DPACKAGE_LOCALE_DIR=\"/\" -I. -I.. -I$(gpreddir) $(GOO_CFLAGS)
CFLAGS = -DVERSION_SHORT=$(VERSION_SHORT) -DHAVE_CONFIG_H -DPACKAGE_LOCALE_DIR=\"/\" -I. -I.. -I$(gpreddir)

# source paths
vpath %.c $(sgpsdpdir)
Expand Down Expand Up @@ -63,40 +58,15 @@ NXJSONSRC = \

NXJSONOBJ = $(NXJSONSRC:.c=.o)

GOOCANVSRC = \
goocanvasatk.c \
goocanvasellipse.c \
goocanvasenumtypes.c \
goocanvasgroup.c \
goocanvasimage.c \
goocanvasitem.c \
goocanvasitemmodel.c \
goocanvasitemsimple.c \
goocanvasmarshal.c \
goocanvaspolyline.c \
goocanvaspath.c \
goocanvasprivate.h \
goocanvasrect.c \
goocanvasstyle.c \
goocanvastable.c \
goocanvastext.c \
goocanvasutils.c \
goocanvaswidget.c \
goocanvas.c


GOOCANVOBJ = $(GOOCANVSRC:.c=.o)


GPREDICTSRC = \
about.c \
compat.c \
first-time.c \
gpredict-help.c \
gpredict-utils.c \
gtk-azel-plot.c \
gtk-event-list.c \
gtk-event-list-popup.c \
gtk-event-list.c \
gtk-event-list-popup.c \
gtk-freq-knob.c \
gtk-polar-plot.c \
gtk-polar-view.c \
Expand All @@ -113,7 +83,7 @@ GPREDICTSRC = \
gtk-sat-module.c \
gtk-sat-module-popup.c \
gtk-sat-module-tmg.c \
gtk-sat-popup-common.c \
gtk-sat-popup-common.c \
gtk-sat-selector.c \
gtk-single-sat.c \
gtk-sky-glance.c \
Expand Down Expand Up @@ -184,14 +154,13 @@ OBJS = $(SGPSDPOBJ) $(NXJSONOBJ) $(GPREDICTOBJ)
$(CC) -c $(CFLAGS) $(GTK_CFLAGS) $<
$(CC) -MM $(CFLAGS) $(GTK_CFLAGS) $< > $*.d


# targets begin

all: libsgpsdp.dll gpredict.exe gpredict-con.exe

dist: gpredict-$(GITMAJ).$(GITMIN).$(GITBLD).zip
dist: gpredict-$(VERSION_SHORT).zip

gpredict-$(GITMAJ).$(GITMIN).$(GITBLD).zip: all
gpredict-$(VERSION_SHORT).zip: all
mkdir -p gpredict/doc
cp -p ../AUTHORS ../COPYING ../NEWS ../README gpredict/doc
mkdir -p gpredict/share/gpredict
Expand All @@ -206,9 +175,14 @@ gpredict-$(GITMAJ).$(GITMIN).$(GITBLD).zip: all
cp -rp $(SCHEMAS) gpredict/share/glib-2.0
mkdir -p gpredict/share/icons/Adwaita
cp -rp $(ADWAITA)/scalable gpredict/share/icons/Adwaita/
cp -rp $(ADWAITA)/scalable-up-to-32 gpredict/share/icons/Adwaita/
cp -rp $(ADWAITA)/index.theme gpredict/share/icons/Adwaita/
cp -rp $(ADWAITA)/icon-theme.cache gpredict/share/icons/Adwaita/

# gtk runtime
for dll in $(shell ldd ./gpredict.exe | grep /mingw64 | awk '{print $$3}'); do \
cp -p "$$dll" gpredict/; \
done

zip -r $@ gpredict
rm -rf gpredict

Expand All @@ -223,15 +197,10 @@ gpredict.exe gpredict-con.exe: $(OBJS) gpredict_res.o
gpredict_res.o: gpredict.rc
$(RC) $(RCFLAGS) gpredict.rc $@

libgoocanvas.dll: $(GOOCANVOBJ)
$(CC) -shared $(CFLAGS) $(GTK_CFLAGS) $(GOOCANVOBJ) $(GTKLIBS) -lm -lmingwex \
-Wl,--enable-auto-image-base -Wl,--out-implib,libgoocanvas.lib -o libgoocanvas.dll

libsgpsdp.dll: $(SGPSDPOBJ)
$(CC) -shared $(CFLAGS) $(GTK_CFLAGS) $(SGPSDPOBJ) $(GLIBLIB) -lm -lmingwex \
-Wl,--enable-auto-image-base -Wl,--out-implib,libsgpsdp.lib -o libsgpsdp.dll

clean:
rm -f *.o *.d *.def *.a *.lib *.dll *.exe *.zip
rm -rf gpredict

10 changes: 8 additions & 2 deletions win32/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@ MINGW_ROOT=/mingw64
PKG_CONFIG_PATH = "$(abspath $(MINGW_ROOT)/lib/pkgconfig)"

# binary dependencies to be deployed with gpredict.exe
# librsvg-2-2.dll and libxml2-16.dll are needed for pixbufloader_svg.dll
# gspawn-win64-helper.exe and gspawn-win64-helper-console.exe are required for hyperlinks to launch
BINDEPS = \
$(wildcard $(MINGW_ROOT)/bin/*.dll) \
$(MINGW_ROOT)/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.dll \
$(MINGW_ROOT)/lib/gdk-pixbuf-2.0/2.10.0/loaders/pixbufloader_svg.dll \
$(MINGW_ROOT)/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.dll \
$(MINGW_ROOT)/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jpeg.dll
$(MINGW_ROOT)/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jpeg.dll \
$(MINGW_ROOT)/bin/librsvg-2-2.dll \
$(MINGW_ROOT)/bin/libxml2-16.dll \
$(MINGW_ROOT)/bin/gspawn-win64-helper.exe \
$(MINGW_ROOT)/bin/gspawn-win64-helper-console.exe

# where to put the loaders.cache file
LOADERS = lib/gdk-pixbuf-2.0/2.10.0
Expand Down
9 changes: 4 additions & 5 deletions win32/loaders.cache
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# GdkPixbuf Image Loader Modules file
# Automatically generated file, do not edit
# Created by gdk-pixbuf-query-loaders.exe from gdk-pixbuf-2.30.1
# Created by gdk-pixbuf-query-loaders from gdk-pixbuf-2.44.5
#
# LoaderDir = Z:\srv\win32builder\fixed_3104\build\win32/lib/gdk-pixbuf-2.0/2.10.0/loaders
# LoaderDir = C:\msys64\mingw64\lib\gdk-pixbuf-2.0\2.10.0\loaders
#
"libpixbufloader-svg.dll"
"svg" 2 "gdk-pixbuf" "Scalable Vector Graphics" "LGPL"
"pixbufloader_svg.dll"
"svg" 6 "gdk-pixbuf" "Scalable Vector Graphics" "LGPL"
"image/svg+xml" "image/svg" "image/svg-xml" "image/vnd.adobe.svg+xml" "text/xml-svg" "image/svg+xml-compressed" ""
"svg" "svgz" "svg.gz" ""
" <svg" "* " 100
Expand All @@ -23,4 +23,3 @@
"jpeg" "jpe" "jpg" ""
"\377\330" "" 100