source: libcf/trunk/test/makefile@ 106

Last change on this file since 106 was 106, checked in by cheese, 11 years ago

#1 fix makefile for test

File size: 1.1 KB
RevLine 
[14]1#----------------------------------------------------------
2# platform
3#----------------------------------------------------------
[73]4include ../makeinclude/userdefine.mk
5include ../makeinclude/platform.mk
[14]6
7#----------------------------------------------------------
8# env
9#----------------------------------------------------------
10TARGET_PATH = ../_build
11OBJ_PATH = ../_obj
12
13INCLUDES = -I../include
[84]14LIBS = -L$(TARGET_PATH) -lcf -lpthread
[14]15
16LIB_CF = $(TARGET_PATH)/lib$(TARGET_PATH).$(EXT_SHARED)
17
18#----------------------------------------------------------
19# label
20#----------------------------------------------------------
[106]21all:
22 make $(shell ls *.c | awk -F. '{ print $$1 }')
23
[35]24dep: $(OBJ_PATH) $(TARGET_PATH) $(LIB_CF)
25
[14]26$(TARGET_PATH): dummy
27 @if [ ! -d $@ ] ; then mkdir $@ ; fi
28$(OBJ_PATH): dummy
29 @if [ ! -d $@ ] ; then mkdir $@ ; fi
30$(LIB_CF): dummy
31 cd ../src; make all;
32
[35]33%: %.c
34 make dep
[76]35 $(CC) $(CDEFS) $(CFLAGS) $(INCLUDES) $(LDFLAGS) -o $(TARGET_PATH)/$@.$(EXT_EXECUTE) $? $(LIBS)
[38]36 cd $(TARGET_PATH); LD_LIBRARY_PATH=. ./$@.$(EXT_EXECUTE)
[14]37
38clean: dummy
[19]39 rm -rf *.txt
[14]40 rm -rf $(TARGET_PATH) $(OBJ_PATH)
41
42dummy:
Note: See TracBrowser for help on using the repository browser.