Makefile 1.8 KB
Newer Older
Dmitriy Beykun's avatar
Dmitriy Beykun committed
1
#
Dmitriy Beykun's avatar
Dmitriy Beykun committed
2
# Copyright (C) 2010-2011 ARM Limited. All rights reserved.
Dmitriy Beykun's avatar
Dmitriy Beykun committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#       http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

UMP_DIR ?= .
UMP_LIB ?= libUMP
UDD_OS ?= linux
TARGET_CC ?= $(CROSS_COMPILE)gcc
TARGET_AR ?= $(CROSS_COMPILE)ar
22
23
INSTALL = install -m 644
includedir ?= /usr/include
Jari Helaakoski's avatar
Jari Helaakoski committed
24
libdir ?= /usr/lib
25
26
CFLAGS += -I$(UMP_DIR)/include -I$(UMP_DIR)/include/ump -Wall -march=armv7-a -mthumb-interwork -fno-strict-aliasing -fPIC -Wno-strict-aliasing -Wno-long-long -O3
LDFLAGS += -Wl,--no-as-needed -ldri2 -ldrm -lXfixes
Dmitriy Beykun's avatar
Dmitriy Beykun committed
27
28
29
30
31
32
33
34
include ump.mak

%.o: %.c
	$(TARGET_CC) -c -o $@ $< $(CFLAGS)

UMP_OBJS := $(UMP_SRCS:.c=.o)

libUMP.so: $(UMP_OBJS)
35
	$(TARGET_CC) -shared -o $@ $(UMP_OBJS) $(CFLAGS) $(LDFLAGS)
Dmitriy Beykun's avatar
Dmitriy Beykun committed
36
37
38
libUMP.a: $(UMP_OBJS)
	$(TARGET_AR) rcs $@ $(UMP_OBJS)

39
40
install: all
	$(INSTALL) libUMP.so $(libdir)/libUMP.so
Jari Helaakoski's avatar
Jari Helaakoski committed
41
	mkdir $(includedir)/ump
42
43
44
45
46
47
48
	$(INSTALL) include/ump/ump.h $(includedir)/ump/ump.h
	$(INSTALL) include/ump/ump_platform.h  $(includedir)/ump/ump_platform.h	
	$(INSTALL) include/ump/ump_debug.h  $(includedir)/ump/ump_debug.h
	$(INSTALL) include/ump/ump_osu.h  $(includedir)/ump/ump_osu.h
	$(INSTALL) include/ump/ump_ref_drv.h  $(includedir)/ump/ump_ref_drv.h
	$(INSTALL) include/ump/ump_uk_types.h  $(includedir)/ump/ump_uk_types.h

Dmitriy Beykun's avatar
Dmitriy Beykun committed
49
50
51
52
53
.DEFAULT_GOAL = all
all: libUMP.so libUMP.a

clean:
	-rm -f $(UMP_OBJS) libUMP.so libUMP.a
54
55

.PHONY: all clean install