nmake.mak 2.47 KB
Newer Older
thomas's avatar
   
thomas committed
1
2
3
4
5
6
7
# required settings:
#
# PLATFORM - win/mac/lnx
# RTSYS - pd/max
# COMPILER - msvc/gcc/mingw/cygwin
# BUILDPATH including trailing \

thomas's avatar
thomas committed
8
###############################################
thomas's avatar
   
thomas committed
9
# package info
thomas's avatar
thomas committed
10

thomas's avatar
thomas committed
11
12
13
!ifndef PKGINFO
PKGINFO=package.txt
!endif
thomas's avatar
thomas committed
14

thomas's avatar
thomas committed
15
!include $(PKGINFO)
thomas's avatar
thomas committed
16

thomas's avatar
thomas committed
17
18
19
20
###############################################
# check variables

!ifndef BUILDCLASS
thomas's avatar
thomas committed
21
BUILDCLASS=ext
thomas's avatar
thomas committed
22
23
24
!endif

!ifndef BUILDMODE
thomas's avatar
thomas committed
25
BUILDMODE=release
thomas's avatar
thomas committed
26
27
28
!endif

!ifndef BUILDTYPE
thomas's avatar
thomas committed
29
BUILDTYPE=single
thomas's avatar
thomas committed
30
31
32
33
34
35
36
37
38
39
40
41
42
!endif

##############################

!ifndef TARGETMODE
TARGETMODE=$(BUILDMODE)
!endif

!ifndef TARGETTYPE
TARGETTYPE=$(BUILDTYPE)
!endif

###############################################
thomas's avatar
   
thomas committed
43
44
45
46
47
48

SYSCONFIG=$(BUILDPATH)config-$(PLATFORM)-$(RTSYS)-$(COMPILER).txt
SYSDEFAULT=$(BUILDPATH)$(PLATFORM)\$(RTSYS)\config-$(COMPILER).def

OPTIONS=-f $(BUILDPATH)nmake-sub.mak \
	PLATFORM=$(PLATFORM) RTSYS=$(RTSYS) COMPILER=$(COMPILER) \
thomas's avatar
thomas committed
49
	BUILDPATH=$(BUILDPATH) PKGINFO=$(PKGINFO) BUILDCLASS=$(BUILDCLASS)
thomas's avatar
   
thomas committed
50

thomas's avatar
thomas committed
51
###############################################
thomas's avatar
   
thomas committed
52

thomas's avatar
thomas committed
53
!ifdef BUILDDIR
thomas's avatar
   
thomas committed
54
USRCONFIG=config.txt
thomas's avatar
thomas committed
55
USRDEFAULT=$(BUILDDIR)\config-$(PLATFORM).def
thomas's avatar
   
thomas committed
56

thomas's avatar
thomas committed
57
USRMAKE=$(BUILDDIR)\nmake-$(PLATFORM)-$(COMPILER).inc
thomas's avatar
thomas committed
58
59

OPTIONS=$(OPTIONS) USRCONFIG=$(USRCONFIG) USRMAKE=$(USRMAKE)
thomas's avatar
   
thomas committed
60
61
!endif

thomas's avatar
thomas committed
62
63
###############################################
# include file describing default target dependencies
thomas's avatar
   
thomas committed
64

thomas's avatar
thomas committed
65
!include $(BUILDPATH)targets.inc
thomas's avatar
   
thomas committed
66

thomas's avatar
thomas committed
67
!include $(BUILDPATH)targets-$(BUILDCLASS).inc
thomas's avatar
   
thomas committed
68

thomas's avatar
thomas committed
69
###############################################
thomas's avatar
   
thomas committed
70
71
72
73
74
75
76
77
78
79
80
81

.precious: $(SYSCONFIG) $(USRCONFIG)

$(SYSCONFIG): $(SYSDEFAULT)
	@copy $** $@
	@echo -------------------------------------------------------------------------
	@echo A default system configuration file has been created.
	@echo Please edit $(SYSCONFIG) 
	@echo to match your platform and start again.
	@echo -------------------------------------------------------------------------
	@exit 1

thomas's avatar
thomas committed
82
!ifdef BUILDDIR
thomas's avatar
   
thomas committed
83
84
85
86
87
88
89
90
$(USRCONFIG): $(USRDEFAULT)
	@copy $** $@
	@echo -------------------------------------------------------------------------
	@echo A default package configuration file has been created.
	@echo Please edit $(USRCONFIG) and start again.
	@echo -------------------------------------------------------------------------
	@exit 1

thomas's avatar
thomas committed
91
$(USRDEFAULT) $(USRMAKE):
thomas's avatar
   
thomas committed
92
93
	@echo -------------------------------------------------------------------------
	@echo Your combination of platform, system and compiler is not supported yet.
thomas's avatar
thomas committed
94
95
96
97
	@echo Required files: 
	@echo $(USRDEFAULT)
	@echo and
	@echo $(USRMAKE)
thomas's avatar
   
thomas committed
98
99
100
	@echo -------------------------------------------------------------------------
	@exit 1
!endif