1# 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 alloc.c \ 84 arabic.c \ 85 arglist.c \ 86 autocmd.c \ 87 beval.c \ 88 blob.c \ 89 blowfish.c \ 90 buffer.c \ 91 bufwrite.c \ 92 change.c \ 93 charset.c \ 94 cindent.c \ 95 clientserver.c \ 96 clipboard.c \ 97 cmdhist.c \ 98 cmdexpand.c \ 99 crypt.c \ 100 crypt_zip.c \ 101 debugger.c \ 102 dict.c \ 103 diff.c \ 104 digraph.c \ 105 drawline.c \ 106 drawscreen.c \ 107 edit.c \ 108 eval.c \ 109 evalbuffer.c \ 110 evalfunc.c \ 111 evalvars.c \ 112 evalwindow.c \ 113 ex_cmds.c \ 114 ex_cmds2.c \ 115 ex_docmd.c \ 116 ex_eval.c \ 117 ex_getln.c \ 118 fileio.c \ 119 filepath.c \ 120 findfile.c \ 121 float.c \ 122 fold.c \ 123 getchar.c \ 124 hardcopy.c \ 125 hashtab.c \ 126 help.c \ 127 highlight.c \ 128 if_cscope.c \ 129 indent.c \ 130 insexpand.c \ 131 json.c \ 132 list.c \ 133 locale.c \ 134 main.c \ 135 mark.c \ 136 map.c \ 137 match.c \ 138 mbyte.c \ 139 memfile.c \ 140 memline.c \ 141 menu.c \ 142 message.c \ 143 misc1.c \ 144 misc2.c \ 145 mouse.c \ 146 move.c \ 147 normal.c \ 148 ops.c \ 149 option.c \ 150 optionstr.c \ 151 os_amiga.c \ 152 popupmenu.c \ 153 popupwin.c \ 154 quickfix.c \ 155 regexp.c \ 156 register.c \ 157 screen.c \ 158 scriptfile.c \ 159 search.c \ 160 session.c \ 161 sha256.c \ 162 sign.c \ 163 spell.c \ 164 spellfile.c \ 165 spellsuggest.c \ 166 strings.c \ 167 syntax.c \ 168 tag.c \ 169 term.c \ 170 termlib.c \ 171 testing.c \ 172 textformat.c \ 173 textobject.c \ 174 textprop.c \ 175 time.c \ 176 typval.c \ 177 ui.c \ 178 undo.c \ 179 usercmd.c \ 180 userfunc.c \ 181 version.c \ 182 viminfo.c \ 183 vim9compile.c \ 184 vim9execute.c \ 185 vim9script.c \ 186 vim9type.c \ 187 window.c \ 188 xdiff/xdiffi.c \ 189 xdiff/xemit.c \ 190 xdiff/xhistogram.c \ 191 xdiff/xpatience.c \ 192 xdiff/xprepare.c \ 193 xdiff/xutils.c 194 195OBJ = $(SRC:.c=.o) 196 197# Build everything - Ignoring header dependencies. 198$(BIN): $(OBJ) 199 ${LD} -o $(BIN) $(OBJ) $(LDFLAGS) 200 201# Clean up 202.PHONY: clean 203clean: 204 $(RM) -fv $(OBJ) $(BIN) 205