-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
executable file
·64 lines (49 loc) · 1.47 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
64
#*****************************************************************************
# Copyright :
# Author :
# Date : 2012-10-29
# Version :
# Description : Demo
#****************************************************************************/
MODULE = FileSystem
SHELL = /bin/sh
OS_ARC := x64
IS_X64 := $(shell uname -a|grep -o 'x86_64')
ifdef IS_X64
OS_ARC=x64
else
OS_ARC=x86
endif
OS_VER := $(shell cat /etc/issue)
OS_VER := $(shell echo $(OS_VER)| grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}')
$(warning ${OS_VER})
# directory
DIR_SRC = ./
DIR_BIN = ./bin/${OS_VER}/${OS_ARC}/
DIR_LIB = ../lib/${OS_VER}/${OS_ARC}/
DIR_OBJ = ../obj/$(MODULE)/
# create temporary directory
$(shell mkdir -p ${DIR_BIN})
$(shell mkdir -p ${DIR_OBJ})
#****************************************************************************
CC = g++ -fshort-wchar -O3 -DNDEBUG
#CC = g++
##SHARED = -L. -lSDKFirmwareCrypt -luuid -o
SHARED = -L. -lSDKFirmwareCrypt -luuid -shared -o
FPIC = -fPIC -c
OBJECT_C = $(DIR_SRC)*.cpp
OBJECT_H = $(DIR_SRC)*.h
OBJECT = *.o
##TARGET = testFS
TARGET = $(DIR_BIN)lib${MODULE}.so
#****************************************************************************
$(TARGET):$(OBJECT)
$(CC) $(OBJECT) $(SHARED) $(TARGET)
mv $(OBJECT) $(DIR_OBJ)
cp $(DIR_BIN)lib${MODULE}.so ../Output/
$(OBJECT):$(OBJECT_C) $(OBJECT_H)
$(CC) $(FPIC) $(OBJECT_C)
clean:
rm -f $(TARGET)
rm -fr $(DIR_OBJ)
rm -f ../Output/lib${MODULE}.so