-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
62 lines (48 loc) · 1.51 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
# $Id: Makefile 5 2011-01-31 03:48:23Z henry_groover $
# Makefile for licut
OUTPUT:=../output
HOST_TARGET:=$(shell uname -m)-$(shell uname -s | tr 'L' 'l')
# Override TARGET for cross-compile
TARGET:=${HOST_TARGET}
TGT:=
ifeq (${TARGET},arm-linux)
TGT:=arm-linux-
endif
PACKAGE:=${OUTPUT}/licut-${TARGET}.tgz
SOURCES:=$(wildcard *.cpp)
BINDIR:=${TARGET}/bin
OBJDIR:=${TARGET}/obj
LIBDIR:=
OBJS:=$(patsubst %.cpp,${OBJDIR}/%.o,${SOURCES})
#GFLAGS_LIB:=/usr/local/lib/libgflags_nothreads.a
LIBS:=${GFLAGS_LIB}
LIB_PATHS:=$(addprefix ${LIBDIR}/,${LIBS})
#LDFLAGS += -L${LIBDIR} $(addprefix -l,$(patsubst lib%,%,${LIBS}))
LDFLAGS += -lgflags ${LIB_PATHS}
CFLAGS += -lgflags
LICUT:=${TARGET}/bin/licut
all: ${PACKAGE}
${PACKAGE}: ${LICUT} ${OUTPUT} ${OUTPUT}/${TARGET}
cp ${LICUT} ${OUTPUT}/${TARGET}; svn export --force ../doc ${OUTPUT}/${TARGET}/doc; cd ${OUTPUT}/${TARGET}; tar czf ../$(@F) *
@ls -l $@
${OUTPUT} ${OUTPUT}/${TARGET} ${LIBDIR}:
mkdir -p $@
clean:
rm -f ${LICUT} ${OBJS} ${PACKAGE}
.PHONY: all clean
${LICUT}: ${OBJS} ${LIB_PATHS}
@mkdir -p $(dir $@)
${TGT}${CXX} -o $@ ${OBJS} ${LDFLAGS}
cp $@ [email protected]
${TGT}strip $@
${OBJDIR}/%.o: %.cpp
@mkdir -p $(dir $@)
${TGT}${CXX} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
#ifneq (${SKIP_LIB},1)
#${LIBDIR}/${GFLAGS_LIB}: google-gflags/.libs/${GFLAGS_LIB}
# cp -p -P google-gflags/.libs/*.so* google-gflags/.libs/*.a ${LIBDIR}/
# @touch $@
#endif
#google-gflags/.libs/${GFLAGS_LIB}: config-google-gflags-${TARGET} ${LIBDIR}
# make -C google-gflags
#include google-gflags.mak