forked from zeroc-ice/mcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (51 loc) · 1.45 KB
/
Makefile
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
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#
PREFIX ?= /opt/mcpp-2.7.2
ifeq ($(CFLAGS),)
CFLAGS = -O2
endif
UNAME = $(shell uname)
MACHINE = $(shell uname -m)
LIBDIR = lib
ifeq ($(UNAME),Darwin)
override CFLAGS += -mmacosx-version-min=10.9
endif
ifeq ($(UNAME),Linux)
override CFLAGS += -fPIC -Wno-maybe-uninitialized -Wno-implicit-function-declaration -Wno-unused-result
ifeq ($(MACHINE),i686)
override CFLAGS += -m32
#
# Ubuntu.
#
ifeq ($(shell test -d /usr/lib/i386-linux-gnu && echo 0),0)
LIBDIR = lib/i386-linux-gnu
endif
else
#
# Ubuntu.
#
ifeq ($(shell test -d /usr/lib/x86_64-linux-gnu && echo 0),0)
LIBDIR = lib/x86_64-linux-gnu
endif
#
# Rhel/SLES
#
ifeq ($(shell test -d /usr/lib64 && echo 0),0)
LIBDIR = lib64
endif
endif
endif
ifeq ($(UNAME),AIX)
CC ?= xlc_r
endif
OBJS = directive.o eval.o expand.o mcpp_main.o mbchar.o support.o system.o
$(LIBDIR)/libmcpp.a: $(OBJS)
-mkdir -p $(LIBDIR)
$(AR) rcs $(LIBDIR)/libmcpp.a $(OBJS)
install: $(LIBDIR)/libmcpp.a
@mkdir -p $(PREFIX)/$(LIBDIR)
cp $(LIBDIR)/libmcpp.a $(PREFIX)/$(LIBDIR)
clean:
rm -f $(OBJS)
rm -rf $(LIBDIR)