summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: 383a4c2e1d823ada94a5bfcd15e7c2077d9b7dad (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
48
49
50
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
SUBDIRS = commands sh ui

bin_PROGRAMS = engrampa
libexec_PROGRAMS = engrampa-server
noinst_PROGRAMS = test-server

if MKDTEMP_MISSING
MKDTEMP_FILES=mkdtemp.c mkdtemp.h
else
MKDTEMP_FILES=
endif

if RUN_IN_PLACE
privdatadir = $(top_srcdir)/data/
uidir = $(top_srcdir)/data/ui
privexecdir = $(abs_top_builddir)/src/commands/
shdir = $(top_srcdir)/src/sh/
else
privdatadir = $(datadir)/engrampa/
uidir = $(datadir)/engrampa/ui
privexecdir = $(libexecdir)/engrampa/
shdir = $(libexecdir)/engrampa/
endif

AM_CPPFLAGS =						\
	-I$(top_srcdir)/copy-n-paste/			\
	-I$(top_srcdir)					\
	-I$(top_builddir)				\
	-DENGRAMPA_RESOURCE_UI_PATH="\"/org/mate/Engrampa/ui\"" \
	-DFR_PREFIX=\"$(prefix)\"           		\
        -DFR_SYSCONFDIR=\"$(sysconfdir)\"   		\
        -DFR_DATADIR=\"$(datadir)\"     	    	\
        -DPRIVDATADIR=\"$(privdatadir)\"		\
        -DUI_DIR=\"$(uidir)\"				\
        -DFR_LIBDIR=\"$(libdir)\"  	         	\
        -DPKG_DATA_DIR=\"$(pkgdatadir)\"                \
	-DPIXMAPSDIR=\""$(datadir)/pixmaps"\"		\
	-DGLADEDIR=\""$(gladedir)"\" 			\
	-DPRIVEXECDIR=\"$(privexecdir)\"		\
	-DSHDIR=\"$(shdir)\"				\
	$(FR_CFLAGS)					\
	$(JSON_GLIB_CFLAGS)

BUILT_SOURCES =			\
	fr-marshal.c		\
	fr-marshal.h		\
	fr-enum-types.h		\
	fr-enum-types.c		\
	fr-resources.c		\
	fr-resources.h		\
	$(NULL)

COMMON_SOURCES = 			\
	actions.h			\
	actions.c			\
	dlg-add-files.c			\
	dlg-add-files.h			\
	dlg-add-folder.c		\
	dlg-add-folder.h		\
	dlg-ask-password.c		\
	dlg-ask-password.h		\
	dlg-batch-add.c			\
	dlg-batch-add.h			\
	dlg-delete.c			\
	dlg-delete.h			\
	dlg-extract.c			\
	dlg-extract.h			\
	dlg-new.c			\
	dlg-new.h			\
	dlg-open-with.c			\
	dlg-open-with.h			\
	dlg-package-installer.c		\
	dlg-package-installer.h		\
	dlg-password.c			\
	dlg-password.h			\
	dlg-prop.c			\
	dlg-prop.h			\
	dlg-update.c			\
	dlg-update.h			\
	eggfileformatchooser.c		\
	eggfileformatchooser.h		\
	egg-macros.h			\
	eggtreemultidnd.c		\
	eggtreemultidnd.h		\
	file-data.c			\
	file-data.h			\
	file-utils.c			\
	file-utils.h			\
	fr-archive.c			\
	fr-archive.h			\
	fr-command.c			\
	fr-command.h			\
	fr-command-ace.c		\
	fr-command-ace.h		\
	fr-command-alz.c		\
	fr-command-alz.h		\
	fr-command-ar.c			\
	fr-command-ar.h			\
	fr-command-arj.c		\
	fr-command-arj.h		\
	fr-command-cfile.c		\
	fr-command-cfile.h		\
	fr-command-cpio.c		\
	fr-command-cpio.h		\
	fr-command-dpkg.c		\
	fr-command-dpkg.h		\
	fr-command-iso.c		\
	fr-command-iso.h		\
	fr-command-jar.h		\
	fr-command-jar.c		\
	fr-command-lha.c		\
	fr-command-lha.h		\
	fr-command-rar.c		\
	fr-command-rar.h		\
	fr-command-rpm.c		\
	fr-command-rpm.h		\
	fr-command-tar.c		\
	fr-command-tar.h		\
	fr-command-unstuff.c		\
	fr-command-unstuff.h		\
	fr-command-zip.c		\
	fr-command-zip.h		\
	fr-command-lrzip.c		\
	fr-command-lrzip.h		\
	fr-command-zoo.c		\
	fr-command-zoo.h		\
	fr-command-7z.c			\
	fr-command-7z.h			\
	fr-error.c			\
	fr-error.h			\
	fr-init.c			\
	fr-init.h			\
	fr-list-model.c			\
	fr-list-model.h			\
	fr-stock.c			\
	fr-stock.h			\
	fr-proc-error.c			\
	fr-proc-error.h			\
	fr-process.c			\
	fr-process.h			\
	fr-window.c			\
	fr-window.h			\
	gio-utils.c			\
	gio-utils.h			\
	glib-utils.c			\
	glib-utils.h			\
	gtk-utils.c			\
	gtk-utils.h			\
	java-utils.c			\
	java-utils.h			\
	open-file.c			\
	open-file.h			\
	preferences.c			\
	preferences.h			\
	rar-utils.c			\
	rar-utils.h			\
	typedefs.h			\
	ui.h				\
	$(MKDTEMP_FILES)		\
	$(BUILT_SOURCES)

if ENABLE_JSON_GLIB
COMMON_SOURCES +=			\
	fr-command-unarchiver.h		\
	fr-command-unarchiver.c
endif

fr-marshal.h: fr-marshal.list $(GLIB_GENMARSHAL)
	$(AM_V_GEN)( $(GLIB_GENMARSHAL) $< --header --prefix=fr_marshal > $@ )

fr-marshal.c: fr-marshal.list $(GLIB_GENMARSHAL)
	$(AM_V_GEN)( echo "#include \"fr-marshal.h\"" > $@ && \
	$(GLIB_GENMARSHAL) $< --body --prefix=fr_marshal >> $@ )

fr-enum-types.h: typedefs.h $(GLIB_MKENUMS)
	$(AM_V_GEN)( $(GLIB_MKENUMS) \
		--fhead "#ifndef FR_ENUM_TYPES_H\n#define FR_ENUM_TYPES_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
		--fprod "/* enumerations from \"@filename@\" */\n" \
		--vhead "GType @enum_name@_get_type (void);\n#define FR_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
		--ftail "G_END_DECLS\n\n#endif /* FR_ENUM_TYPES_H */" \
		$^> xgen-$(@F) \
	&& (cmp -s xgen-$(@F) fr-enum-types.h || cp xgen-$(@F) fr-enum-types.h ) \
	&& rm -f xgen-$(@F) )

fr-enum-types.c: typedefs.h fr-enum-types.h
	$(AM_V_GEN)( $(GLIB_MKENUMS) \
		--fhead "#include <glib-object.h>\n" \
		--fprod "\n/* enumerations from \"@filename@\" */\n#include \"@filename@\"" \
		--vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {" \
		--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
		--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
		$^> xgen-$(@F) \
	&& (cmp -s xgen-$(@F) fr-enum-types.c || cp xgen-$(@F) fr-enum-types.c ) \
	&& rm -f xgen-$(@F) )

fr-resources.c: engrampa.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies engrampa.gresource.xml)
	$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name fr $(srcdir)/engrampa.gresource.xml

fr-resources.h: engrampa.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies engrampa.gresource.xml)
	$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name fr $(srcdir)/engrampa.gresource.xml

engrampa_SOURCES = 			\
	$(COMMON_SOURCES)		\
	main.c

engrampa_LDADD =					\
	$(top_builddir)/copy-n-paste/libeggsmclient.la	\
	$(FR_LIBS)					\
	${JSON_GLIB_LIBS}

engrampa_server_SOURCES =		\
	$(COMMON_SOURCES)		\
	server.c

engrampa_server_LDADD =		\
	$(engrampa_LDADD)

test_server_SOURCES = test-server.c
test_server_FLAGS = $(FR_CFLAGS)
test_server_LDADD = $(FR_LIBS)

if ENABLE_MAGIC
engrampa_LDADD += $(MAGIC_LIBS)
endif

EXTRA_DIST = 				\
	engrampa.gresource.xml		\
	fr-marshal.list

CLEANFILES = $(BUILT_SOURCES)

dist-hook:
	cd $(distdir); rm -f $(CLEANFILES)

-include $(top_srcdir)/git.mk