#*********************************************************************************
|
# Copyright: (C) 2012 Guo Wenxue<Email:guowenxue@gmail.com>
|
# All rights reserved.
|
#
|
# Filename: Makefile
|
# Description: This Makefile used to call function to compile all the C source
|
# in current folder and links all the objects file into a excutable
|
# binary file.
|
#
|
# Version: 1.0.0(10/08/2011~)
|
# Author: Guo Wenxue <guowenxue@gmail.com>
|
# ChangeLog: 1, Release initial version on "10/08/2011 01:29:33 AM"
|
#
|
#********************************************************************************/
|
|
PWD=$(shell pwd)
|
INSTPATH=/tftp
|
|
APP_BINARY_NAME = sp2sck
|
|
LDFLAGS+=-lpthread
|
CFLAGS+=-Wall -Werror
|
|
VPATH= .
|
SRCS = $(wildcard ${VPATH}/*.c)
|
OBJS = $(patsubst %.c,%.o,$(SRCS))
|
|
CFLAGS+=-I${PWD}
|
|
CROSS_COMPILE=/opt/xtools/arm920t/bin/arm-linux-
|
export CC=${CROSS_COMPILE}gcc
|
export CXX=${CROSS_COMPILE}g++
|
export AR=${CROSS_COMPILE}ar
|
export AS=${CROSS_COMPILE}as
|
export RANLIB=${CROSS_COMPILE}ranlib
|
export STRIP=${CROSS_COMPILE}strip
|
export CFLAGS
|
export LDFLAGS
|
|
|
all: entry $(APP_BINARY_NAME)
|
make install
|
|
entry:
|
@echo " ";
|
@echo " =========================================================";
|
@echo " ** Compile ${APP_BINARY_NAME} by ${CC} ";
|
@echo " =========================================================";
|
|
$(APP_BINARY_NAME): $(OBJS)
|
$(CC) -o $@ *.c ${LDFLAGS}
|
@$(STRIP) $(APP_BINARY_NAME)
|
|
tag:
|
@ctags --c-kinds=+defglmnstuvx --langmap=c:.c.h.ho.hem.het.hec.hev.him.hit.hic.hiv -R .
|
@cscope -Rbq
|
|
install:
|
@cp $(APP_BINARY_NAME) ${INSTPATH}
|
|
clean:
|
@rm -f *.o $(APP_BINARY_NAME)
|
@rm -rf *.gdb *.a *.so *.elf*
|
@rm -f *.log
|
|
distclean: clean
|
@rm -f tags cscope*
|
|
.PHONY: clean entry
|