Makefile.win32 4.85 KB
Newer Older
Richard Hult's avatar
Richard Hult committed
1 2 3 4
#
# Makefile.win32
#

5
SUBDIRS=docs libplanner src po
6
INSTALLERTMP = installer/tmp
Richard Hult's avatar
Richard Hult committed
7

8
VERSION := `sed <configure.ac -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'`
Richard Hult's avatar
Richard Hult committed
9 10 11 12 13 14

ifeq ($(DESTDIR),)
export DESTDIR=$(HOME)
endif

ifeq ($(PREFIX),)
15
export PREFIX=/dev
Richard Hult's avatar
Richard Hult committed
16 17
endif

18 19 20
export CFLAGS := $(CFLAGS) -Wall -Wunused -Wchar-subscripts -Wmissing-declarations \
	-Wmissing-prototypes -Wnested-externs -Wpointer-arith \
	-Wno-sign-compare -Wno-pointer-sign -Werror
Richard Hult's avatar
Richard Hult committed
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

RECURSIVE_TARGETS = all-recursive clean-recursive install-recursive uninstall-recursive

$(RECURSIVE_TARGETS):
	@set fnord $$MAKEFLAGS; version=$(VERSION); amf=$$2; \
	dot_seen=no; \
	target=`echo $@ | sed s/-recursive//`; \
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  echo "Making $$target in $$subdir"; \
	  if test "$$subdir" = "."; then \
	    dot_seen=yes; \
	    local_target="$$target-am"; \
	  else \
	    local_target="$$target"; \
	  fi; \
	  (cd $$subdir && $(MAKE) -f Makefile.win32 $$local_target VERSION=$$version) \
	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
	done; \
	if test "$$dot_seen" = "no"; then \
	  $(MAKE) -f Makefile.win32 "$$target-am" || exit 1; \
	fi; test -z "$$fail"

all: all-recursive
all-am:

clean: clean-recursive

clean-am:
	rm -f config.h
50
	rm -rf $(INSTALLERTMP)
Richard Hult's avatar
Richard Hult committed
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 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131

DTD = \
	mrproject-0.5.1.dtd		\
	mrproject-0.6.dtd

GLADE = \
	add-predecessor.glade		\
	calendar-dialog.glade		\
	column-dialog.glade		\
	group-dialog.glade		\
	new-property.glade		\
	project-properties.glade	\
	property-dialog.glade		\
	resource-dialog.glade		\
	resource-input-dialog.glade	\
	sql.glade			\
	task-dialog.glade		\
	task-input-dialog.glade		\
	task-date-widget.glade		\
	eds.glade

IMAGES = 				\
	tasks.png			\
	gantt.png			\
	resources.png			\
	resources_usage.png		\
	24_insert_task.png		\
	24_remove_task.png		\
	24_unlink_task.png		\
	24_link_task.png		\
	24_indent_task.png		\
	24_unindent_task.png		\
	24_insert_resource.png		\
	24_remove_resource.png		\
	24_edit_resource.png		\
	24_groups.png			\
	24_task_down.png		\
	24_task_up.png			\
	gnome-planner.png

SQL = \
	database-0.13.sql		\
	database-0.11.sql		\
	database.sql			\
	upgrade-0.11-0.13.sql		\
	upgrade-0.6.x-0.11.sql

STYLESHEETS = \
	planner2html.xsl		\
	html1_css.xsl			\
        html1_gantt.xsl			\
        html1_resources.xsl		\
        html1_tasks.xsl			\
	planner2plannerv011.xsl		\
	msp2planner.xsl

UI = \
	gantt-view.ui		\
	task-view.ui		\
	gantt-view.ui		\
	html-plugin.ui		\
	main-window.ui		\
	resource-view.ui	\
	sql-plugin.ui		\
	task-view.ui		\
	xml-planner-plugin.ui	\
	time-table-view.ui	\
	eds-plugin.ui		\
	msp-plugin.ui

COPYFILES = \
	mkdir -p $$dest; \
	for file in $$list; do \
	  cp $$src/$$file $$dest; \
	done

RMFILES = \
	for file in $$list; do \
	  rm -f $$dest/$$file; \
	done

132 133 134 135 136
GTK_BINFILES = \
	libart_lgpl_2-2.dll		\
	libexslt.dll			\
	libglade-2.0-0.dll		\
	libgnomecanvas-2-0.dll		\
137
	libxml2-2.dll			\
138
	libxml2.dll			\
139
	libxslt.dll
140 141 142

createinstaller:
	DESTDIR=$$(pwd)/$(INSTALLERTMP) $(MAKE) -f Makefile.win32 install
143
	@GTK_FILES="$(addprefix /bin/,$(GTK_BINFILES))"; \
144 145
	mkdir -p $(INSTALLERTMP)/planner; \
	for file in $${GTK_FILES}; do \
146 147 148 149 150
		echo "Copying $(PREFIX)/$${file}..."; \
		if [ ! -e $(PREFIX)/$${file} ]; then \
			echo "Failed to locate '$(PREFIX)/$${file}' while gathering files for installer!"; \
			exit -1; \
		fi; \
151 152 153
		mkdir -p $(INSTALLERTMP)/planner/$$(dirname $${file}); \
		cp -r $(PREFIX)/$${file} $(INSTALLERTMP)/planner/$$(dirname $${file})/; \
	done
154 155 156 157 158 159 160 161
	for MAKENSIS in \
		/c/Program\ Files/NSIS/makensis \
		/c/Program\ Files\ \(x86\)/NSIS/makensis; do \
		if [ -e "$${MAKENSIS}" ]; then \
			break; \
		fi; \
	done; \
	"$${MAKENSIS}" -v3 -DPLANNER_VERSION=$(VERSION) -DSTAGING_DIR=.\\tmp\\planner installer/planner-installer.nsi
162

Richard Hult's avatar
Richard Hult committed
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
install: install-recursive
install-am:
	-mkdir -p $(DESTDIR)/planner
	cp COPYING $(DESTDIR)/planner
	dest=$(DESTDIR)/planner/share/planner/dtd; list='$(DTD)'; src=data/dtd; \
	$(COPYFILES)
	dest=$(DESTDIR)/planner/share/planner/glade; list='$(GLADE)'; src=data/glade; \
	$(COPYFILES)
	dest=$(DESTDIR)/planner/share/pixmaps/planner; list='$(IMAGES)'; src=data/images; \
	$(COPYFILES)
	dest=$(DESTDIR)/planner/share/planner/sql; list='$(SQL)'; src=data/sql; \
	$(COPYFILES)
	dest=$(DESTDIR)/planner/share/planner/stylesheets; list='$(STYLESHEETS)'; src=data/stylesheets; \
	$(COPYFILES)
	dest=$(DESTDIR)/planner/share/planner/ui; list='$(UI)'; src=data/ui; \
	$(COPYFILES)

uninstall: uninstall-recursive
uninstall-am:
	rm -f $(DESTDIR)/planner/COPYING
	dest=$(DESTDIR)/planner/share/planner/dtd; list='$(DTD)'; \
	$(RMFILES)
	dest=$(DESTDIR)/planner/share/planner/glade; list='$(GLADE)'; \
	$(RMFILES)
	dest=$(DESTDIR)/planner/share/pixmaps/planner; list='$(IMAGES)'; \
	$(RMFILES)
	dest=$(DESTDIR)/planner/share/planner/sql; list='$(SQL)'; \
	$(RMFILES)
	dest=$(DESTDIR)/planner/share/planner/stylesheets; list='$(STYLESHEETS)'; \
	$(RMFILES)
	dest=$(DESTDIR)/planner/share/planner/ui; list='$(UI)'; \
	$(RMFILES)