【linux】最小测试工程miniTest

实例文件夹:https://download.csdn.net/download/bandaoyu/12271704

[root@Lrw888 local]# tree -L 2 minitest/
minitest/
├── build.sh
├── include
│   ├── hwclientcomm.h
│   ├── hwclientplat.h
│   └── pbasetype.h
├── lib
│   ├── libclientcomm.a
│   └── libframe.a
├── release
│   └── helloword
└── src
    ├── main.c
    └── Makefile

 

makefile

TARGET=helloword
LIB_PATH = ../lib
CC = gcc
SRC_PATH = ../src

CFLAGS = $(CFLAG) -I.  -I../include  -g -Wall
 
LIBPATH = -L. -L$(LIB_PATH)/
LIBS = -lpthread -lz -lclientcomm -lframe -lrt -ldl



OBJS_TARGET=$(SRC_PATH)/main.o 

$(TARGET): $(OBJS_TARGET)
	$(CC) -o $(TARGET) $(OBJS_TARGET) $(LIBPATH) $(LIBS)

$%.o : %.c
	$(CC) $(CFLAGS) -c -o $@ $< 

.PHONY:clean release

release:
	cp $(TARGET) ../release

clean:
	rm -rf $(TARGET) $(OBJS_TARGET)
	rm -f ../release/*.dll
	rm -f ../release/*.exe

 

posted on 2022-10-04 01:27  bdy  阅读(23)  评论(0编辑  收藏  举报

导航