-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
57 lines (39 loc) · 1.13 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
##===- Makefile --------------------------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
#
# Build a preleminary version of libomptarget.so
#
##===----------------------------------------------------------------------===##
CPP_FILES := $(wildcard src/*.cpp)
INC_FILES := $(wildcard src/*.h)
OBJ_FILES := $(subst src/,obj/,$(CPP_FILES:.cpp=.o))
CC := g++
CFLAGS := -c -fPIC -I src/ -std=c++11 -Wall
LDFLAGS := -shared -lelf -ldl
ifdef OMPTARGET_DEBUG
CFLAGS += -g -DOMPTARGET_DEBUG
endif
all : lib/libomptarget.so build_rtls build_dev_rtls
lib/libomptarget.so : $(OBJ_FILES)
@ mkdir -p lib
$(CC) $(LDFLAGS) -o $@ $(OBJ_FILES)
obj/%.o: src/%.cpp $(INC_FILES)
@ mkdir -p obj
$(CC) $(CFLAGS) $< -o $@
clean: clean_rtls clean_dev_rtls
rm -rf obj
rm -rf lib
build_rtls:
make -C RTLs
build_dev_rtls:
make -C DevRTLs
clean_rtls:
make -C RTLs clean
clean_dev_rtls:
make -C DevRTLs clean