#
#filename:Makefile for SPI
#Authors:yuanfat<>
#Version:1.0
#
#Create Time:2010.2.5
#Last Modified:2010.2.5
#
src=$(wildcard src/*.c)
obj=$(patsubst src/%.c,out/%PIC.o,$(src))
CC=gcc
CFLAGS=-g -Wall -DSPI_DBG_MSGS -DSPI_DAEMON_ENABLED
CFLAGSLIB=-fPIC
LDFLAGS=-shared
target=out/libopenspi.so
vpath %.o out
vpath %.c src
vpath %.h inc
all:$(target)
$(target):$(obj)
$(CC) $(LDFLAGS) -o $@ $(obj) -Iinc -lpthread
$(obj):$(patsubst out/%PIC.o,src/%.c,$(@))
$(CC) $(CFLAGS) $(CFLAGSLIB) -c -o $@ $(patsubst out/%PIC.o,src/%.c,$(@)) -Iinc
.PHONY:
clean:
rm -f $(obj)
rm -f $(target)
阅读(467) | 评论(0) | 转发(0) |