#
Copyright (c) 2006 HXHT, Inc. All rights reserved.
#
#compiler and linker
CXX
=
g
++
CC
=
gcc
LINKER
=
g
++
MAKE
=
make
#
control version save-dir
ifdef HXHT_RELEASE
BIN_DIR
=
./
release
else
BIN_DIR
=
./
debug
endif
#
source code dir
VPATH
:=
./
src
#
target
TARGET
=
$(BIN_DIR)
/
HikVideoSvrHC
#
compile macro
COMP_MACRO
=
-
D_REENTRANT
-
D__USE_POSIX
-
D__linux__
-
DIP_DEBUG
#
compile flags
CCFLAGS
+=
$(COMP_MACRO)
-
g
-
Wall
#
libs
LIB_DIR
=
-
L
./
hc4000_sdk
-
L
./
g729decoder
SYS_LIBS
=
-
lpthread
-
ldl
-
lstdc
++
-
lm
-
lcrypt
PROJECT_LIBS
=
-
lACE
-
lds40xxsdk
-
lg729decoder
LIBS
=
$(SYS_LIBS) $(LIB_DIR) $(PROJECT_LIBS)
#
optimization
CCFLAGS
+=
-
O2
#
EACH DIRECTORY WITH HEADERS MUST BE APPENDED IN THIS MANNER TO THE CCFLAGS
CCFLAGS
+=
-
I
.
CCFLAGS
+=
-
I$(ACE_ROOT)
#
CCFLAGS += -I./src
# EACH DIRECTORY WITH A STATIC LIBRARY MUST BE APPENDED IN THIS MANNER TO THE LINKOPTS
CXXFLAGS
:=
$(CCFLAGS)
CFLAGS
=
CPPFILES
=
AlarmHandler
.
cpp
\
AlarmInGetPolicyReq
.
cpp
\
AlarmInSetPolicyReq
.
cpp
\
AlarmOutStatusReq
.
cpp
\
Writer
.
cpp
CFILES
=
OBJ_DIR
=
./
obj
/
OBJS
=
$(addprefix $(OBJ_DIR)
,
$(notdir $(CPPFILES
:%.
cpp
=%.
o)))
all
:
$(TARGET)
$(TARGET)
:
$(OBJS)
$(LINKER)
-
o $@ $(OBJS) $(CXXFLAGS) $(LIBS)
#
$(OBJS):$($(notdir $@):%.o=%.cpp)
$(OBJ_DIR)
%.
o
:%.
cpp
$(CXX) $(CXXFLAGS)
-
c $
^
-
o $@
$(OBJ_DIR)
%.
o
:%.
c
$(CC) $(CCFLAGS)
-
c $
^
-
o $@
check
:
ldd
-
r $(NAME)
clean
:
-
rm
-
f $(OBJS)
cleanall
:
clean all
-
rm
-
f $(TARGET)
.
PHONY
:
all check clean cleanall
posted on 2006-12-01 10:49
崔少伟 阅读(933)
评论(0) 编辑 收藏 引用 所属分类:
linux develop