-
Notifications
You must be signed in to change notification settings - Fork 2
/
Make_ami.mak
executable file
·67 lines (61 loc) · 2.5 KB
/
Make_ami.mak
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
#------------------------------------------------------------------------------------------
# Host settings
#------------------------------------------------------------------------------------------
UNM?=$(shell uname)
ifeq ($(UNM),AmigaOS)
ifeq ($(shell uname),AmigaOS)
GOP=-E # Only if we're not cross compiling.
endif
MKF:=Make_ami.mak
else ifeq ($(UNM),AROS)
MKF:=Make_ami.mak
else ifeq ($(UNM),MorphOS)
MKF:=Make_ami.mak
else
#-This is just for testing purposes--------------------------------------------------------
MKF:=Makefile
endif
#------------------------------------------------------------------------------------------
# General settings
#------------------------------------------------------------------------------------------
SRC:=src
DST:=dist
VER=$(shell cat $(SRC)/.ver)
PAT=$(shell cat $(SRC)/.pat)
BLD=$(shell date +%d.%m.%Y || echo Unknown)
#------------------------------------------------------------------------------------------
# Build Vim - Both MUI and Huge.
#------------------------------------------------------------------------------------------
.PHONY: vim
vim: $(SRC)/.ver $(SRC)/.pat
$(MAKE) -C $(SRC) -f $(MKF) clean
$(MAKE) -C $(SRC) -f $(MKF) PATCHLEVEL=$(PAT) BUILDDATE=$(BLD) BUILD=mui
mv $(SRC)/vim $@
$(MAKE) -C $(SRC) -f $(MKF) clean
$(MAKE) -C $(SRC) -f $(MKF) PATCHLEVEL=$(PAT) BUILDDATE=$(BLD) BUILD=huge
mv $(SRC)/vim $(SRC)/vi
mv $@ $(SRC)/vim
#------------------------------------------------------------------------------------------
# Create archive
#------------------------------------------------------------------------------------------
.PHONY: $(DST)
$(DST): vim
$(MAKE) -C $(DST) VER=$(VER) REV=$(PAT)
#------------------------------------------------------------------------------------------
# Determine version
#------------------------------------------------------------------------------------------
$(SRC)/.ver: Makefile
@echo $(VDOT) > $@
#------------------------------------------------------------------------------------------
# Determine patch number
#------------------------------------------------------------------------------------------
$(SRC)/.pat: $(SRC)/version.c
grep $(GOP) -m1 "^ \{4\}[0-9]\{1,4\}," $< | tr -d "[:space:]," > $@
#------------------------------------------------------------------------------------------
# Clean up
#------------------------------------------------------------------------------------------
.PHONY: clean
clean:
$(MAKE) -C $(DST) $@
$(MAKE) -C $(SRC) -f $(MKF) $@
rm -f $(SRC)/.pat $(SRC)/.ver $(SRC)/vi $(SRC)/vim