Merge branch 'obsd-master'
[tmux.git] / Makefile.am
blob8e5f72b16cca7eade56cff18b122b10b2b483e17
1 # Obvious program stuff.
2 bin_PROGRAMS = tmux
3 CLEANFILES = tmux.1.mdoc tmux.1.man cmd-parse.c
5 # Distribution tarball options.
6 EXTRA_DIST = \
7         CHANGES README README.ja COPYING example_tmux.conf \
8         osdep-*.c mdoc2man.awk tmux.1
9 dist_EXTRA_tmux_SOURCES = compat/*.[ch]
11 # Preprocessor flags.
12 AM_CPPFLAGS += @XOPEN_DEFINES@ \
13         -DTMUX_VERSION='"@VERSION@"' \
14         -DTMUX_CONF='"$(sysconfdir)/tmux.conf:~/.tmux.conf:$$XDG_CONFIG_HOME/tmux/tmux.conf:~/.config/tmux/tmux.conf"' \
15         -DTMUX_LOCK_CMD='"@DEFAULT_LOCK_CMD@"' \
16         -DTMUX_TERM='"@DEFAULT_TERM@"'
18 # Additional object files.
19 LDADD = $(LIBOBJS)
21 # Set flags for gcc.
22 if IS_GCC
23 AM_CFLAGS += -std=gnu99 -O2
24 if IS_DEBUG
25 AM_CFLAGS += -g
26 AM_CFLAGS += -Wno-long-long -Wall -W -Wformat=2
27 AM_CFLAGS += -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
28 AM_CFLAGS += -Wwrite-strings -Wshadow -Wpointer-arith -Wsign-compare
29 AM_CFLAGS += -Wundef -Wbad-function-cast -Winline -Wcast-align
30 AM_CFLAGS += -Wdeclaration-after-statement -Wno-pointer-sign -Wno-attributes
31 AM_CFLAGS += -Wno-unused-result -Wno-format-y2k
32 if IS_DARWIN
33 AM_CFLAGS += -Wno-deprecated-declarations -Wno-cast-align
34 endif
35 AM_CPPFLAGS += -DDEBUG
36 endif
37 AM_CPPFLAGS += -iquote.
38 endif
40 # Set flags for Solaris.
41 if IS_SUNOS
42 if IS_GCC
43 AM_CPPFLAGS += -D_XPG6
44 else
45 AM_CPPFLAGS += -D_XPG4_2
46 endif
47 endif
49 # Set flags for Sun CC.
50 if IS_SUNCC
51 AM_CFLAGS += -erroff=E_EMPTY_DECLARATION
52 endif
54 # Set _LINUX_SOURCE_COMPAT for AIX for malloc(0).
55 if IS_AIX
56 AM_CPPFLAGS += -D_LINUX_SOURCE_COMPAT=1
57 endif
59 # Set flags for NetBSD.
60 if IS_NETBSD
61 AM_CPPFLAGS += -D_OPENBSD_SOURCE
62 endif
64 # Set flags for Haiku.
65 if IS_HAIKU
66 AM_CPPFLAGS += -D_BSD_SOURCE
67 endif
69 # List of sources.
70 dist_tmux_SOURCES = \
71         alerts.c \
72         arguments.c \
73         attributes.c \
74         cfg.c \
75         client.c \
76         cmd-attach-session.c \
77         cmd-bind-key.c \
78         cmd-break-pane.c \
79         cmd-capture-pane.c \
80         cmd-choose-tree.c \
81         cmd-command-prompt.c \
82         cmd-confirm-before.c \
83         cmd-copy-mode.c \
84         cmd-detach-client.c \
85         cmd-display-menu.c \
86         cmd-display-message.c \
87         cmd-display-panes.c \
88         cmd-find-window.c \
89         cmd-find.c \
90         cmd-if-shell.c \
91         cmd-join-pane.c \
92         cmd-kill-pane.c \
93         cmd-kill-server.c \
94         cmd-kill-session.c \
95         cmd-kill-window.c \
96         cmd-list-buffers.c \
97         cmd-list-clients.c \
98         cmd-list-keys.c \
99         cmd-list-panes.c \
100         cmd-list-sessions.c \
101         cmd-list-windows.c \
102         cmd-load-buffer.c \
103         cmd-lock-server.c \
104         cmd-move-window.c \
105         cmd-new-session.c \
106         cmd-new-window.c \
107         cmd-parse.y \
108         cmd-paste-buffer.c \
109         cmd-pipe-pane.c \
110         cmd-queue.c \
111         cmd-refresh-client.c \
112         cmd-rename-session.c \
113         cmd-rename-window.c \
114         cmd-resize-pane.c \
115         cmd-resize-window.c \
116         cmd-respawn-pane.c \
117         cmd-respawn-window.c \
118         cmd-rotate-window.c \
119         cmd-run-shell.c \
120         cmd-save-buffer.c \
121         cmd-select-layout.c \
122         cmd-select-pane.c \
123         cmd-select-window.c \
124         cmd-send-keys.c \
125         cmd-server-access.c \
126         cmd-set-buffer.c \
127         cmd-set-environment.c \
128         cmd-set-option.c \
129         cmd-show-environment.c \
130         cmd-show-messages.c \
131         cmd-show-options.c \
132         cmd-show-prompt-history.c \
133         cmd-source-file.c \
134         cmd-split-window.c \
135         cmd-swap-pane.c \
136         cmd-swap-window.c \
137         cmd-switch-client.c \
138         cmd-unbind-key.c \
139         cmd-wait-for.c \
140         cmd.c \
141         colour.c \
142         compat.h \
143         control-notify.c \
144         control.c \
145         environ.c \
146         file.c \
147         format.c \
148         format-draw.c \
149         grid-reader.c \
150         grid-view.c \
151         grid.c \
152         hyperlinks.c \
153         input-keys.c \
154         input.c \
155         job.c \
156         key-bindings.c \
157         key-string.c \
158         layout-custom.c \
159         layout-set.c \
160         layout.c \
161         log.c \
162         menu.c \
163         mode-tree.c \
164         names.c \
165         notify.c \
166         options-table.c \
167         options.c \
168         paste.c \
169         popup.c \
170         proc.c \
171         regsub.c \
172         resize.c \
173         screen-redraw.c \
174         screen-write.c \
175         screen.c \
176         server-acl.c \
177         server-client.c \
178         server-fn.c \
179         server.c \
180         session.c \
181         spawn.c \
182         status.c \
183         style.c \
184         tmux.c \
185         tmux.h \
186         tmux-protocol.h \
187         tty-acs.c \
188         tty-features.c \
189         tty-keys.c \
190         tty-term.c \
191         tty.c \
192         utf8-combined.c \
193         utf8.c \
194         window-buffer.c \
195         window-client.c \
196         window-clock.c \
197         window-copy.c \
198         window-customize.c \
199         window-tree.c \
200         window.c \
201         xmalloc.c \
202         xmalloc.h
203 nodist_tmux_SOURCES = osdep-@PLATFORM@.c
205 # Add compat file for forkpty.
206 if NEED_FORKPTY
207 nodist_tmux_SOURCES += compat/forkpty-@PLATFORM@.c
208 endif
210 # Add compat file for systemd.
211 if HAVE_SYSTEMD
212 nodist_tmux_SOURCES += compat/systemd.c
213 endif
215 # Add compat file for utf8proc.
216 if HAVE_UTF8PROC
217 nodist_tmux_SOURCES += compat/utf8proc.c
218 endif
220 # Enable sixel support.
221 if ENABLE_SIXEL
222 dist_tmux_SOURCES += image.c image-sixel.c
223 endif
225 if NEED_FUZZING
226 check_PROGRAMS = fuzz/input-fuzzer
227 fuzz_input_fuzzer_LDFLAGS = $(FUZZING_LIBS)
228 fuzz_input_fuzzer_LDADD = $(LDADD) $(tmux_OBJECTS)
229 endif
231 # Install tmux.1 in the right format.
232 install-exec-hook:
233         if test x@MANFORMAT@ = xmdoc; then \
234                 sed -e "s|@SYSCONFDIR@|$(sysconfdir)|g" $(srcdir)/tmux.1 \
235                         >$(srcdir)/tmux.1.mdoc; \
236         else \
237                 sed -e "s|@SYSCONFDIR@|$(sysconfdir)|g" $(srcdir)/tmux.1| \
238                         $(AWK) -f $(srcdir)/mdoc2man.awk >$(srcdir)/tmux.1.man; \
239         fi
240         $(mkdir_p) $(DESTDIR)$(mandir)/man1
241         $(INSTALL_DATA) $(srcdir)/tmux.1.@MANFORMAT@ \
242                 $(DESTDIR)$(mandir)/man1/tmux.1