Merge branch 'obsd-master'
[tmux.git] / Makefile.am
blobff0de9f84d28aac99f6fa2dcc7eeeb3cd65c0053
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 -Wno-macro-redefined
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 # Set flags for Cygwin.
70 if IS_CYGWIN
71 AM_CPPFLAGS += -DTMUX_SOCK_PERM=0
72 endif
74 # List of sources.
75 dist_tmux_SOURCES = \
76         alerts.c \
77         arguments.c \
78         attributes.c \
79         cfg.c \
80         client.c \
81         cmd-attach-session.c \
82         cmd-bind-key.c \
83         cmd-break-pane.c \
84         cmd-capture-pane.c \
85         cmd-choose-tree.c \
86         cmd-command-prompt.c \
87         cmd-confirm-before.c \
88         cmd-copy-mode.c \
89         cmd-detach-client.c \
90         cmd-display-menu.c \
91         cmd-display-message.c \
92         cmd-display-panes.c \
93         cmd-find-window.c \
94         cmd-find.c \
95         cmd-if-shell.c \
96         cmd-join-pane.c \
97         cmd-kill-pane.c \
98         cmd-kill-server.c \
99         cmd-kill-session.c \
100         cmd-kill-window.c \
101         cmd-list-buffers.c \
102         cmd-list-clients.c \
103         cmd-list-keys.c \
104         cmd-list-panes.c \
105         cmd-list-sessions.c \
106         cmd-list-windows.c \
107         cmd-load-buffer.c \
108         cmd-lock-server.c \
109         cmd-move-window.c \
110         cmd-new-session.c \
111         cmd-new-window.c \
112         cmd-parse.y \
113         cmd-paste-buffer.c \
114         cmd-pipe-pane.c \
115         cmd-queue.c \
116         cmd-refresh-client.c \
117         cmd-rename-session.c \
118         cmd-rename-window.c \
119         cmd-resize-pane.c \
120         cmd-resize-window.c \
121         cmd-respawn-pane.c \
122         cmd-respawn-window.c \
123         cmd-rotate-window.c \
124         cmd-run-shell.c \
125         cmd-save-buffer.c \
126         cmd-select-layout.c \
127         cmd-select-pane.c \
128         cmd-select-window.c \
129         cmd-send-keys.c \
130         cmd-server-access.c \
131         cmd-set-buffer.c \
132         cmd-set-environment.c \
133         cmd-set-option.c \
134         cmd-show-environment.c \
135         cmd-show-messages.c \
136         cmd-show-options.c \
137         cmd-show-prompt-history.c \
138         cmd-source-file.c \
139         cmd-split-window.c \
140         cmd-swap-pane.c \
141         cmd-swap-window.c \
142         cmd-switch-client.c \
143         cmd-unbind-key.c \
144         cmd-wait-for.c \
145         cmd.c \
146         colour.c \
147         compat.h \
148         control-notify.c \
149         control.c \
150         environ.c \
151         file.c \
152         format.c \
153         format-draw.c \
154         grid-reader.c \
155         grid-view.c \
156         grid.c \
157         hyperlinks.c \
158         input-keys.c \
159         input.c \
160         job.c \
161         key-bindings.c \
162         key-string.c \
163         layout-custom.c \
164         layout-set.c \
165         layout.c \
166         log.c \
167         menu.c \
168         mode-tree.c \
169         names.c \
170         notify.c \
171         options-table.c \
172         options.c \
173         paste.c \
174         popup.c \
175         proc.c \
176         regsub.c \
177         resize.c \
178         screen-redraw.c \
179         screen-write.c \
180         screen.c \
181         server-acl.c \
182         server-client.c \
183         server-fn.c \
184         server.c \
185         session.c \
186         spawn.c \
187         status.c \
188         style.c \
189         tmux.c \
190         tmux.h \
191         tmux-protocol.h \
192         tty-acs.c \
193         tty-features.c \
194         tty-keys.c \
195         tty-term.c \
196         tty.c \
197         utf8-combined.c \
198         utf8.c \
199         window-buffer.c \
200         window-client.c \
201         window-clock.c \
202         window-copy.c \
203         window-customize.c \
204         window-tree.c \
205         window.c \
206         xmalloc.c \
207         xmalloc.h
208 nodist_tmux_SOURCES = osdep-@PLATFORM@.c
210 # Add compat file for forkpty.
211 if NEED_FORKPTY
212 nodist_tmux_SOURCES += compat/forkpty-@PLATFORM@.c
213 endif
215 # Add compat file for systemd.
216 if HAVE_SYSTEMD
217 nodist_tmux_SOURCES += compat/systemd.c
218 endif
220 # Add compat file for utf8proc.
221 if HAVE_UTF8PROC
222 nodist_tmux_SOURCES += compat/utf8proc.c
223 endif
225 # Enable sixel support.
226 if ENABLE_SIXEL
227 dist_tmux_SOURCES += image.c image-sixel.c
228 endif
230 if NEED_FUZZING
231 check_PROGRAMS = fuzz/input-fuzzer
232 fuzz_input_fuzzer_LDFLAGS = $(FUZZING_LIBS)
233 fuzz_input_fuzzer_LDADD = $(LDADD) $(tmux_OBJECTS)
234 endif
236 # Install tmux.1 in the right format.
237 install-exec-hook:
238         if test x@MANFORMAT@ = xmdoc; then \
239                 sed -e "s|@SYSCONFDIR@|$(sysconfdir)|g" $(srcdir)/tmux.1 \
240                         >$(srcdir)/tmux.1.mdoc; \
241         else \
242                 sed -e "s|@SYSCONFDIR@|$(sysconfdir)|g" $(srcdir)/tmux.1| \
243                         $(AWK) -f $(srcdir)/mdoc2man.awk >$(srcdir)/tmux.1.man; \
244         fi
245         $(mkdir_p) $(DESTDIR)$(mandir)/man1
246         $(INSTALL_DATA) $(srcdir)/tmux.1.@MANFORMAT@ \
247                 $(DESTDIR)$(mandir)/man1/tmux.1