-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakerules
90 lines (75 loc) · 2.12 KB
/
Makerules
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
OS := $(shell uname -s)
ARCH := $(shell uname -m)
platform := windows
subplatform :=
ifeq ($(OS), Linux)
platform := linux
ifeq ($(ARCH), ia64)
subplatform := ia64
endif
ifeq ($(ARCH), x86_64)
subplatform := 64
endif
endif
ifeq ($(OS), Darwin)
ifeq ($(ARCH), i386)
platform := osxx86
endif
endif
ifeq ($(TOPDIR),)
TOPDIR = .
endif
_DUMMY0 := $(shell if [ ! -f $(TOPDIR)/config ]; then touch $(TOPDIR)/config; fi)
include $(TOPDIR)/config
ifeq ($(M32), yes)
subplatform :=
endif
_DUMMY1 := $(shell if [ ! -f $(TOPDIR)/config.$(platform)$(subplatform) ]; then touch $(TOPDIR)/config.$(platform)$(subplatform); fi)
include $(TOPDIR)/config.$(platform)$(subplatform)
# Macros which are common to all Unix platforms
VERSION := 1.11.2
BUILD := $(shell date +%Y%m%d)
ifeq ($(DEBUG), yes)
BUILD := $(BUILD)d
endif
BLDDIR = $(TOPDIR)/$(platform)$(subplatform)
BLDDIR32 = $(TOPDIR)/$(platform)
ifeq ($(DEBUG), yes)
BLDDIR := $(TOPDIR)/$(BLDDIR)/dbg
BLDDIR32 := $(TOPDIR)/$(BLDDIR32)/dbg
endif
ENAME = bin
LNAME = lib
ONAME = obj
EDIR := $(BLDDIR)/$(ENAME)
EDIR32 := $(BLDDIR32)/$(ENAME)
LDIR := $(BLDDIR)/$(LNAME)
LDIR32 := $(BLDDIR32)/$(LNAME)
ODIR := $(BLDDIR)/$(ONAME)
ODIR32 := $(BLDDIR32)/$(ONAME)
_DUMMY := $(shell mkdir -p $(EDIR))
_DUMMY2 := $(shell mkdir -p $(LDIR))
_DUMMY3 := $(shell mkdir -p $(ODIR))
_DUMMY4 := $(shell mkdir -p $(EDIR)/ipp)
_DUMMY5 := $(shell mkdir -p $(LDIR)/ipp)
_DUMMY6 := $(shell mkdir -p $(ODIR)/ipp)
_DUMMY7 := $(shell mkdir -p $(EDIR)/libjpeg)
_DUMMY8 := $(shell mkdir -p $(LDIR)/libjpeg)
_DUMMY9 := $(shell mkdir -p $(ODIR)/libjpeg)
RM = rm -f
# System-specific macros
include $(TOPDIR)/Makerules.$(platform)
CINCLUDES := -I.
CDEFINES := $(CDEFINES) -D__VERSION=\"$(VERSION)\" -D__BUILD=\"$(BUILD)\"
ifeq ($(DEBUG), yes)
CDEFINES := $(CDEFINES) -D__DEBUG__
endif
CFLAGS := $(CFLAGS) $(OPTFLAG) $(ARCHFLAG) $(CDEFINES) $(CINCLUDES)
ifneq ($(platform), windows)
LDFLAGS := $(OPTFLAG) $(ARCHFLAG) $(LDFLAGS)
endif
# This assures that the "clean" command runs even if there is a file called
# "clean" in the current directory
.PHONY : clean
include $(TOPDIR)/config
include $(TOPDIR)/config.$(platform)$(subplatform)