blob: 88b39865080772aa90e98db20e7ad32f18aee1ca [file] [log] [blame]
Bram Moolenaara62372b2020-09-09 20:41:40 +02001#
2# Makefile for AROS, AmigaOS4 and MorphOS.
3#
4BIN = vim
5CC ?= gcc
6LD = $(CC)
7UNM ?= $(shell uname)
8DEBUG ?= no
9BUILD ?= huge
10CFLAGS = -c -O3
11
12# Common compiler flags
13CFLAGS += \
14 -DNO_ARP \
15 -DUSE_TMPNAM \
16 -DHAVE_STDARG_H \
17 -DHAVE_TGETENT \
18 -DHAVE_TERMCAP \
19 -DNEW_SHELLSIZE \
20 -I proto \
21 -Wno-attributes \
22 -Wextra
23
24# Vim 'huge' build
25ifeq ($(BUILD),huge)
26CFLAGS += \
27 -DFEAT_BROWSE \
28 -DFEAT_MOUSE \
29 -DFEAT_HUGE
30else
31
32# Vim 'big' build
33ifeq ($(BUILD),big)
34CFLAGS += \
35 -DFEAT_BROWSE \
36 -DFEAT_MOUSE \
37 -DFEAT_BIG
38else
39
40# Vim 'normal' build
41ifeq ($(BUILD),normal)
42CFLAGS +=\
43 -DFEAT_BROWSE \
44 -DFEAT_MOUSE \
45 -DFEAT_NORMAL
46else
47
48# Vim 'small' build
49ifeq ($(BUILD),small)
50CFLAGS += -DFEAT_SMALL
51else
52
53# Vim 'tiny' build
54ifeq ($(BUILD),tiny)
55CFLAGS += -DFEAT_TINY
56endif
57endif
58endif
59endif
60endif
61
62# OS specific compiler flags
63ifeq ($(UNM),AmigaOS)
64LDFLAGS = -mcrt=clib2 -lauto -lm -lnet
65CFLAGS += -DHAVE_FSYNC -D__USE_INLINE__ -mcrt=clib2
66else
67ifeq ($(UNM),AROS)
68LDFLAGS = -DHAVE_FSYNC -ldebug
69else
70ifeq ($(UNM),MorphOS)
71LDFLAGS = -ldebug -noixemul
72endif
73endif
74endif
75
76# Patch level used for Amiga style version string
77ifdef PATCHLEVEL
78CFLAGS += -DPATCHLEVEL=\"$(PATCHLEVEL)\"
79endif
80
81# Common sources
82SRC += \
83 arabic.c \
84 arglist.c \
85 autocmd.c \
86 beval.c \
87 blob.c \
88 blowfish.c \
89 buffer.c \
90 bufwrite.c \
91 change.c \
92 charset.c \
93 cindent.c \
94 clientserver.c \
95 clipboard.c \
96 cmdhist.c \
97 cmdexpand.c \
98 crypt.c \
99 crypt_zip.c \
100 debugger.c \
101 dict.c \
102 diff.c \
103 digraph.c \
104 drawline.c \
105 drawscreen.c \
106 edit.c \
107 eval.c \
108 evalbuffer.c \
109 evalfunc.c \
110 evalvars.c \
111 evalwindow.c \
112 ex_cmds.c \
113 ex_cmds2.c \
114 ex_docmd.c \
115 ex_eval.c \
116 ex_getln.c \
117 fileio.c \
118 filepath.c \
119 findfile.c \
120 fold.c \
121 getchar.c \
122 hardcopy.c \
123 hashtab.c \
124 help.c \
125 highlight.c \
126 if_cscope.c \
127 indent.c \
128 insexpand.c \
129 json.c \
130 list.c \
131 locale.c \
132 main.c \
133 mark.c \
134 map.c \
135 match.c \
136 mbyte.c \
137 memfile.c \
138 memline.c \
139 menu.c \
140 message.c \
141 misc1.c \
142 misc2.c \
143 mouse.c \
144 move.c \
145 normal.c \
146 ops.c \
147 option.c \
148 optionstr.c \
149 os_amiga.c \
150 popupmenu.c \
151 popupwin.c \
152 quickfix.c \
153 regexp.c \
154 register.c \
155 screen.c \
156 scriptfile.c \
157 search.c \
158 session.c \
159 sha256.c \
160 sign.c \
161 spell.c \
162 spellfile.c \
163 spellsuggest.c \
164 syntax.c \
165 tag.c \
166 term.c \
167 termlib.c \
168 testing.c \
169 textformat.c \
170 textobject.c \
171 textprop.c \
172 time.c \
173 typval.c \
174 ui.c \
175 undo.c \
176 usercmd.c \
177 userfunc.c \
178 version.c \
179 viminfo.c \
180 vim9compile.c \
181 vim9execute.c \
182 vim9script.c \
183 vim9type.c \
184 window.c \
185 xdiff/xdiffi.c \
186 xdiff/xemit.c \
187 xdiff/xhistogram.c \
188 xdiff/xpatience.c \
189 xdiff/xprepare.c \
190 xdiff/xutils.c
191
192OBJ = $(SRC:.c=.o)
193
194# Build everything - Ignoring header dependencies.
195$(BIN): $(OBJ)
196 ${LD} -o $(BIN) $(OBJ) $(LDFLAGS)
197
198# Clean up
199.PHONY: clean
200clean:
201 $(RM) -fv $(OBJ) $(BIN)