-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile.inc
executable file
·70 lines (48 loc) · 1.75 KB
/
Makefile.inc
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
# WILL NOT BE PUBLISHED
OBJDIR := $(CUSTOM_BUILD_TYPE)-$(CUSTOM_PLATFORM)
LUNA_STAGING ?= $(HOME)/Local
# ------------------------------------------------------------------
# librolegen.a
# ------------------------------------------------------------------
STATICLIB = $(OBJDIR)/librolegen.a
ISTATICLIB_OBJS =
STATICLIB_OBJS += $(OBJDIR)/rolegen.o
# ------------------------------------------------------------------
# tools
# ------------------------------------------------------------------
MKROLE = $(OBJDIR)/mkls2role
MKROLE_OBJS =
MKROLE_OBJS = $(OBJDIR)/mkls2role.o
MKROLE_LIBS =
MKROLE_LIBS += -lrolegen
MKROLE_LDFLAGS =
MKROLE_LDFLAGS += -L$(OBJDIR)
# ------------------------------------------------------------------
# common
# ------------------------------------------------------------------
LOCAL_CFLAGS += -I$(INCLUDE_DIR)
LOCAL_CFLAGS += -Wall -fPIC -fvisibility=hidden
# ------------------------------------------------------------------
# build rules
# ------------------------------------------------------------------
all: setup $(STATICLIB) $(MKROLE)
setup:
mkdir -p $(OBJDIR)
$(OBJDIR)/%.o: %.cpp
$(CXX) $(CFLAGS) $(LOCAL_CFLAGS) -c $< -o $@
$(MKROLE): $(MKROLE_OBJS)
$(CXX) $(MKROLE_LDFLAGS) $(LDFLAGS) -o $(MKROLE) $(MKROLE_OBJS) $(MKROLE_LIBS)
$(STATICLIB) : $(STATICLIB_OBJS)
$(AR) -rcs $(STATICLIB_LDFLAGS) $(STATICLIB) $(STATICLIB_OBJS)
$(STRIP) --strip-unneeded $(STATICLIB)
clean:
rm -rf $(OBJDIR)
rm -f $(LUNA_STAGING)/include/rolegen.h
install:
mkdir -p $(LUNA_STAGING)/include/rolegen
mkdir -p $(LUNA_STAGING)/lib
install -m 0644 rolegen.h $(LUNA_STAGING)/include/rolegen
cd $(LUNA_STAGING)/include; ln -s rolegen/rolegen.h
install -m 0755 $(STATICLIB) $(LUNA_STAGING)/lib
stage:
echo "nothing to do"