summaryrefslogtreecommitdiffstats
path: root/Makefile.am
blob: 42b5f5947bac48538b65607063e15c6235138986 (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
# Specify automake version.
AUTOMAKE_OPTIONS  = 1.11.3

##
# Rofi the program
##
bin_PROGRAMS=rofi

dist_bin_SCRIPTS=script/rofi-sensible-terminal

LIBS=\
    @xft_LIBS@\
    @x11_LIBS@\
    @xinerama_LIBS@\
	@pango_LIBS@

AM_CFLAGS=\
	@EXTRA_CFLAGS@\
    @xft_CFLAGS@\
    @x11_CFLAGS@\
    @xinerama_CFLAGS@\
    @pango_CFLAGS@\
    -DMANPAGE_PATH="\"$(mandir)/\""\
    -I$(top_srcdir)/include/\
    -I$(top_srcdir)/config/\
    -I$(top_builddir)/\
	-Werror=missing-prototypes

rofi_SOURCES=\
    source/rofi.c\
	source/i3-support.c\
    source/textbox.c\
    source/scrollbar.c\
    source/xrmoptions.c\
    source/history.c\
    config/config.c\
	source/helper.c\
	source/keyb.c\
	source/x11-helper.c\
    source/dialogs/dmenu.c\
    source/dialogs/run.c\
    source/dialogs/window.c\
    source/dialogs/ssh.c\
    source/dialogs/script.c\
    source/dialogs/combi.c\
    include/rofi.h\
    include/i3-support.h\
    include/xrmoptions.h\
    include/history.h\
    include/textbox.h\
    include/scrollbar.h\
	include/helper.h\
	include/keyb.h\
	include/x11-helper.h\
    include/dialogs/run.h\
    include/dialogs/combi.h\
    include/dialogs/window.h\
    include/dialogs/ssh.h\
    include/dialogs/dmenu.h\
    include/dialogs/script.h

##
# Manpage
##
man1_MANS=\
    doc/rofi.1

##
# Readme.md
##
markdown_SC_FILES=\
    README.md

# want the html to show up in release.
md_verbose = $(md_verbose_@AM_V@)
md_verbose_ = $(md_verbose_@AM_DEFAULT_V@)
md_verbose_0 = @echo "  MD" $@;

markdown_FILES=\
    README.html

README.html: README.md
	$(md_verbose) markdown $< > $@


##
# config directory
##
${top_builddir}/config/config.c: ${top_srcdir}/config/config.def.c
	cp ${top_srcdir}/config/config.def.c $@

## 
# Extra DIST
##
EXTRA_DIST=\
    $(man1_MANS)\
    $(markdown_FILES)\
    $(markdown_SC_FILES)\
    Examples/i3_switch_workspaces.sh\
    Examples/brightness_rofi.sh\
    Examples/domo_rofi_script.sh\
    ${top_srcdir}/config/config.def.c\
    INSTALL.md\
	AUTHORS\
	Changelog

##
# Indent
##


update-manpage: ${top_srcdir}/doc/rofi-manpage.markdown
	ronn --roff --pipe $^ > ${top_srcdir}/doc/rofi.1

##
# Rofi test program
##
noinst_PROGRAMS=rofi_test textbox_test helper_test


rofi_test_SOURCES=\
    source/history.c\
    config/config.c\
    include/rofi.h\
    include/history.h\
	test/history-test.c

textbox_test_SOURCES=\
    source/textbox.c\
    config/config.c\
	source/keyb.c\
	source/x11-helper.c\
	source/xrmoptions.c\
	source/helper.c\
	include/keyb.h\
    include/rofi.h\
    include/textbox.h\
	include/x11-helper.h\
	include/xrmoptions.h\
	include/helper.h\
	test/textbox-test.c

helper_test_SOURCES=\
    config/config.c\
    include/rofi.h\
    source/helper.c\
    include/helper.h\
	include/xrmoptions.h\
	source/xrmoptions.c\
    test/helper-test.c

.PHONY: test
test: ${bin_PROGRAMS} 
	./rofi_test
	./helper_test

.PHONY: test-x
test-x: ${bin_PROGRAMS}
	echo "Test 1"	
	$(top_srcdir)/test/run_test.sh 123 $(top_builddir)/textbox_test $(top_builddir) $(top_srcdir)/doc/example.xresources
	echo "Test 2"
	$(top_srcdir)/test/run_test.sh 200 $(top_srcdir)/test/run_errormsg_test.sh $(top_builddir) $(top_srcdir)/doc/example.xresources
	echo "Test 3"
	$(top_srcdir)/test/run_test.sh 201 $(top_srcdir)/test/run_switchdialog_test.sh $(top_builddir) $(top_srcdir)/doc/example.xresources
	echo "Test 4"
	$(top_srcdir)/test/run_test.sh 202 $(top_srcdir)/test/run_dmenu_test.sh $(top_builddir) $(top_srcdir)/doc/example.xresources
	echo "Test 5"
	$(top_srcdir)/test/run_test.sh 203 $(top_srcdir)/test/run_dmenu_custom_test.sh $(top_builddir) $(top_srcdir)/doc/example.xresources
	echo "Test 6"
	$(top_srcdir)/test/run_test.sh 204 $(top_srcdir)/test/run_run_test.sh $(top_builddir) $(top_srcdir)/doc/example.xresources
	echo "Test 7"
	$(top_srcdir)/test/run_test.sh 205 $(top_srcdir)/test/run_script_test.sh $(top_builddir) $(top_srcdir)/doc/example.xresources
	echo "End tests"


.PHONY: indent
indent: ${rofi_SOURCES} ${top_srcdir}/config/config.def.c ${helper_test_SOURCES} ${textbox_test_SOURCES} ${rofi_test_SOURCES}
	uncrustify -c ${top_srcdir}/data/uncrustify.cfg --replace $^

.PHONY: cppcheck

cppcheck: ${rofi_SOURCES}
	cppcheck --std=c99 --platform=unix64 --enable=all -Uerror_dialog -I ${top_srcdir}/include/  $^

.PHONY: ohcount

ohcount: ${rofi_SOURCES}
	ohcount -i ${top_srcdir}/source/