From 3baa1ff0ea9c24f4ecf0f818f2c5909d6d918f5e Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期二, 19 一月 2021 18:26:49 +0800 Subject: [PATCH] delete Makefile. use cmake --- /dev/null | 39 --------------------------------------- test/futex_test.cpp | 1 - 2 files changed, 0 insertions(+), 40 deletions(-) diff --git a/Make.common.inc b/Make.common.inc deleted file mode 100644 index fa0d30f..0000000 --- a/Make.common.inc +++ /dev/null @@ -1,34 +0,0 @@ -.PHONY: help -help: - @make --print-data-base --question no-such-target | \ - grep -v -e '^no-such-target' -e '^makefile' | \ - awk '/^[^.%][-A-Za-z0-9_]*:/ \ - { print substr($$1, 1, length($$1)-1) }' | \ - sort | \ - pr --omit-pagination --width=80 --columns=4 \ - - - -$(DEST)/%.d: %.cpp - @echo generating dependences of $< ... - @test -d $(DEST)/$(shell dirname $<) || mkdir -p $(DEST)/$(shell dirname $<); \ - $(CC) -M $(CPPFLAGS) $< > $@.$$$$; \ - sed 's,\($*\)\.o[ :]*,$(DEST)/\1 $(DEST)/\1.o $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$ - -$(DEST)/%.o: %.cpp - $(CC) ${CPPFLAGS} $(CFLAGS) -c $(filter %.cpp, $^) -o $@ - -$(DEST)/%/%.o: %.cpp - $(CC) ${CPPFLAGS} $(CFLAGS) -c $(filter %.cpp, $^) -o $@ - -${DEST}/%: %.o - $(CC) $(LDFLAGS) $(filter %.o, $^) -o $@ $(LDLIBS) - -${DEST}/%: %.cpp - $(CC) ${CPPFLAGS} $(CFLAGS) $(LDFLAGS) $(filter %.cpp, $^) -o $@ $(LDLIBS) - -gdb: - gdb -n -x .gdbinit - - diff --git a/Make.defines.freebsd b/Make.defines.freebsd deleted file mode 100755 index 2e240d7..0000000 --- a/Make.defines.freebsd +++ /dev/null @@ -1,19 +0,0 @@ -# Common make definitions, customized for each platform - -# Definitions required in all program directories to compile and link -# C programs using gcc. - -CC=gcc -COMPILE.c=$(CC) $(CFLAGS) $(CPPFLAGS) -c -LINK.c=$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -LDFLAGS= -LDDIR=-L$(ROOT)/lib -LDLIBS=$(LDDIR) -lapue $(EXTRALIBS) -CFLAGS=-ansi -I$(ROOT)/include -std=c++11 -Wall -DBSD -D__BSD_VISIBLE $(EXTRA) -RANLIB=ranlib -AR=ar -AWK=awk -LIBAPUE=$(ROOT)/lib/libapue.a - -# Common temp files to delete from each directory. -TEMPFILES=core core.* *.o temp.* *.out diff --git a/Make.defines.linux b/Make.defines.linux deleted file mode 100755 index 2a1fddc..0000000 --- a/Make.defines.linux +++ /dev/null @@ -1,68 +0,0 @@ -# Common make definitions, customized for each platform - - - -# Cross-compiler jos toolchain -# -# This Makefile will automatically use the cross-compiler toolchain -# installed as 'i386-jos-elf-*', if one exists. If the host tools ('gcc', -# 'objdump', and so forth) compile for a 32-bit x86 ELF target, that will -# be detected as well. If you have the right compiler toolchain installed -# using a different name, set GCCPREFIX explicitly in conf/env.mk - -# try to infer the correct GCCPREFIX -ifndef GCCPREFIX -GCCPREFIX := $(shell if i386-jos-elf-objdump -i 2>&1 | grep '^elf32-i386$$' >/dev/null 2>&1; \ - then echo 'i386-jos-elf-'; \ - elif objdump -i 2>&1 | grep 'elf32-i386' >/dev/null 2>&1; \ - then echo ''; \ - else echo "***" 1>&2; \ - echo "*** Error: Couldn't find an i386-*-elf version of GCC/binutils." 1>&2; \ - echo "*** Is the directory with i386-jos-elf-gcc in your PATH?" 1>&2; \ - echo "*** If your i386-*-elf toolchain is installed with a command" 1>&2; \ - echo "*** prefix other than 'i386-jos-elf-', set your GCCPREFIX" 1>&2; \ - echo "*** environment variable to that prefix and run 'make' again." 1>&2; \ - echo "*** To turn off this error, run 'gmake GCCPREFIX= ...'." 1>&2; \ - echo "***" 1>&2; exit 1; fi) -endif - -# Definitions required in all program directories to compile and link -# C programs using gcc. -DEBUG=y -CC = g++ -# COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -# LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) - -# preprocessor options -CPPFLAGS += $(INCLUDES) -std=c++11 -# compilation options -CFLAGS += $(DEBUGFLAGS) -Wall -DLINUX -D_GNU_SOURCE $(EXTRA) -# linked options -LDFLAGS += - - -LDDIR += -L$(ROOT)/lib -LDLIBS += $(RPATH) $(LDDIR) $(EXTRALIBS) - -INCLUDES += -I. -I./include -I$(ROOT)/include - -DEST=$(ROOT)/build -# DEST=. - -ifeq ($(DEBUG),y) - DEBUGFLAGS = -O -g # "-O" is needed to expand inlines -else - DEBUGFLAGS = -O2 -endif - - - -RANLIB=echo -AR=ar -AWK=awk -NM := $(GCCPREFIX)nm - -# Common temp files to delete from each directory. -TEMPFILES=core core.* *.o temp.* *.out *.a *.so *.sym - - diff --git a/Make.defines.macos b/Make.defines.macos deleted file mode 100755 index 8a7862d..0000000 --- a/Make.defines.macos +++ /dev/null @@ -1,30 +0,0 @@ -# Common make definitions, customized for each platform - -# Definitions required in all program directories to compile and link -# C programs using gcc. - -CC=g++ -COMPILE.c=$(CC) $(CFLAGS) $(CPPFLAGS) -c -LINK.c=$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -LDFLAGS= -LDDIR += -L$(ROOT)/lib -LDLIBS += $(LDDIR) $(EXTRALIBS) -INCLUDE += -I. -I./include -I$(ROOT)/include -I$(ROOT)/include/usgcommon - -ifeq ($(DEBUG),y) - DEBFLAGS = -O -g # "-O" is needed to expand inlines -else - DEBFLAGS = -O2 -endif - -CFLAGS=-ansi -mcx16 $(INCLUDE) $(DEBFLAGS) -std=c++11 -Wall -DMACOS -D_DARWIN_C_SOURCE $(EXTRA) -RANLIB=ranlib -AR=ar -AWK=awk - -# Common temp files to delete from each directory. -TEMPFILES=core core.* **/*.o temp.* *.out *.a *.so - - -%: %.c - $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) diff --git a/Make.defines.solaris b/Make.defines.solaris deleted file mode 100755 index daa28de..0000000 --- a/Make.defines.solaris +++ /dev/null @@ -1,20 +0,0 @@ -# Common make definitions, customized for each platform - -# Definitions required in all program directories to compile and link -# C programs using gcc. - -CC=gcc -COMPILE.c=$(CC) $(CFLAGS) $(CPPFLAGS) -c -LINK.c=$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -LDFLAGS= -LDDIR=-L$(ROOT)/lib -LDLIBS=$(LDDIR) -lapue $(EXTRALIBS) -CFLAGS=-std=c99 -m64 -I$(ROOT)/include -std=c++11 -Wall -DSOLARIS -D__EXTENSIONS__ $(EXTRA) -RANLIB=echo -AR=ar -AWK=nawk -LIBAPUE=$(ROOT)/lib/libapue.a -NAMEMAX=-DNAME_MAX=_XOPEN_NAME_MAX - -# Common temp files to delete from each directory. -TEMPFILES=core core.* *.o temp.* *.out diff --git a/Makefile b/Makefile deleted file mode 100755 index df8a65d..0000000 --- a/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -# debug "make --just-print" -DIRS = src test_net_socket -TAR_NAME = shm_queue.tar.gz - -all: - @for i in $(DIRS); do \ - (cd $$i && echo ">>>>>> making $$i ..." && $(MAKE) ) || exit 1; \ - done - -clean: - @for i in $(DIRS); do \ - (cd $$i && echo ">>>>>> cleaning $$i ..." && $(MAKE) clean) || exit 1; \ - done - - -tar: - rm -f $(TAR_NAME) - git archive --format tar.gz --output $(TAR_NAME) master \ No newline at end of file diff --git a/demo/Makefile b/demo/Makefile deleted file mode 100644 index 9e1429f..0000000 --- a/demo/Makefile +++ /dev/null @@ -1,40 +0,0 @@ - - -ROOT := .. -PLATFORM=$(shell $(ROOT)/systype.sh) -include $(ROOT)/Make.defines.$(PLATFORM) - -#RPATH += -Wl,-rpath=${ROOT}/lib -# 寮�婧愬伐鍏峰寘璺緞 -LDDIR += -L${DEST}/lib - -# 寮�婧愬伐鍏峰寘 -LDLIBS += -lshm_queue -lusgcommon -lpthread - -INCLUDES += -I${DEST}/include/shmqueue -I$(ROOT)/include/usgcommon - - -PROGS = ${DEST}/dgram_mod_req_rep ${DEST}/dgram_mod_survey ${DEST}/dgram_mod_bus - -DEPENDENCES = $(patsubst %, %.d, $(PROGS)) - -#LIBCOMMON=${ROOT}/lib/libusgcommon.a - -build: $(PROGS) - - -# class -#$(DEST)/kucker : kucker.c - - -clean: - rm -f $(PROGS) $(DEPENDENCES) $(TEMPFILES) - -# $(LIBCOMMON): -# @(cd $(ROOT)/common && $(MAKE)) - --include $(DEPENDENCES) -include $(ROOT)/Make.common.inc - - - diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index df2a8dc..0000000 --- a/src/Makefile +++ /dev/null @@ -1,91 +0,0 @@ -# -# Makefile for common library. -# -ROOT := .. -PLATFORM=$(shell $(ROOT)/systype.sh) -include $(ROOT)/Make.defines.$(PLATFORM) - -PREFIX = $(DEST) - -LIBSQUEUE = $(DEST)/lib/libshm_queue.a -DLIBSQUEUE = $(DEST)/lib/libshm_queue.so - - -# 寮�婧愬伐鍏峰寘 -LDLIBS += -lusgcommon - -#-I$(ROOT)/include/usgcommon - -INCLUDES += -I./shm -I./queue -I./socket -I$(ROOT)/include/usgcommon - -SOURCES := $(wildcard *.cpp ./**/*.cpp) -OBJS = $(patsubst %.cpp, $(DEST)/%.o, $(SOURCES)) -DEPENDENCES = $(patsubst %.cpp, $(DEST)/%.d, $(SOURCES)) - -# MYLIBS = $(LIBCOMMON) $(DLIBCOMMON) - -ifeq ($(DEBUG),y) - MYLIBS = $(LIBSQUEUE) -else - MYLIBS = $(LIBSQUEUE) $(DLIBSQUEUE) -endif - -#PREFIX is environment variable, but if it is not set, then set default value -ifeq ($(PREFIX),) - PREFIX := /usr/local -endif - -all: build - - -.PHONY: build -build: prebuild $(MYLIBS) - cp $(ROOT)/.gdbinit $(DEST) - # mkdir -p $(DEST)/lib - # cp $(MYLIBS) $(DEST)/lib - # mkdir -p $(DEST)/include/shmqueue - # cp ./*.h ./queue/*.h ./socket/*.h $(DEST)/include/shmqueue - # cp $(ROOT)/lib/* $(DEST)/lib - -.PHONY: prebuild -prebuild: - @test -d $(DEST)/lib || mkdir -p $(DEST)/lib - -#static lib -$(LIBSQUEUE): $(OBJS) - @echo '>>>>>>' generating $@ ... - @$(AR) rv $@ $? - @$(RANLIB) $@ - -#dynamic lib -$(DLIBSQUEUE): $(SOURCES) - @echo '>>>>>>' generating $@ ... - $(CC) -fPIC -shared $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS) - - - -# 浣跨敤鏂瑰紡锛� g++ test1.cpp -lcommon -.PHONY: install -install: $(MYLIBS) - @echo '>>>>>>' installing $^ ... - install -d $(PREFIX)/lib/ - install -m 644 $^ $(PREFIX)/lib/ - install -d $(PREFIX)/include/shmqueue - install -m 644 ./*.h ./shm/*.h ./queue/*.h ./socket/*.h $(PREFIX)/include/shmqueue - - -.PHONY: uninstall -uninstall: - @echo '>>>>>>' uninstalling ... - rm -rf $(PREFIX)/include/shmqueue - rm -f $(PREFIX)/lib/shmqueue.* - - -.PHONY: clean -clean: - rm -f $(OBJS) $(MYLIBS) $(DEPENDENCES) $(TEMPFILES) - rm -rf $(DEST)/* - - --include $(DEPENDENCES) -include $(ROOT)/Make.common.inc diff --git a/test/Makefile b/test/Makefile deleted file mode 100755 index c490f5e..0000000 --- a/test/Makefile +++ /dev/null @@ -1,37 +0,0 @@ - -ROOT := .. -PLATFORM=$(shell $(ROOT)/systype.sh) -include $(ROOT)/Make.defines.$(PLATFORM) - -RPATH += -Wl,-rpath=$(ROOT)/lib:$(DEST)/lib -# 寮�婧愬伐鍏峰寘璺緞 -LDDIR += -L$(DEST)/lib - -#-lusgcommon -# 寮�婧愬伐鍏峰寘 -LDLIBS += -lshm_queue -lpthread -lusgcommon - -#-I$(ROOT)/include/usgcommon -INCLUDES += -I${ROOT}/src -I${ROOT}/src/shm -I${ROOT}/src/queue -I${ROOT}/src/socket -I${ROOT}/include/usgcommon - -PROGS = ${DEST}/test_sem - -DEPENDENCES = $(patsubst %, %.d, $(PROGS)) - -#LIBCOMMON=${ROOT}/lib/libusgcommon.a - -build: $(PROGS) - - - -clean: - rm -f $(PROGS) $(DEPENDENCES) $(TEMPFILES) - -# $(LIBCOMMON): -# @(cd $(ROOT)/common && $(MAKE)) - --include $(DEPENDENCES) -include $(ROOT)/Make.common.inc - - - diff --git a/test/futex_test.cpp b/test/futex_test.cpp index 55d77f4..3b31ba4 100644 --- a/test/futex_test.cpp +++ b/test/futex_test.cpp @@ -137,7 +137,6 @@ } /* State: available */ - fwait(futex1); printf("(%ld) 杩涘叆浜掓枼鍖篭n", (long) getpid()); sleep(5); diff --git a/test_net_socket/Makefile b/test_net_socket/Makefile deleted file mode 100644 index 94734be..0000000 --- a/test_net_socket/Makefile +++ /dev/null @@ -1,38 +0,0 @@ - -ROOT := .. -PLATFORM=$(shell $(ROOT)/systype.sh) -include $(ROOT)/Make.defines.$(PLATFORM) - -RPATH += -Wl,-rpath=$(ROOT)/lib:$(DEST)/lib -# 寮�婧愬伐鍏峰寘璺緞 -LDDIR += -L$(DEST)/lib - -#-lusgcommon -# 寮�婧愬伐鍏峰寘 -LDLIBS += -lshm_queue -lpthread -lusgcommon - -#-I$(ROOT)/include/usgcommon -INCLUDES += -I${ROOT}/src -I${ROOT}/src/shm -I${ROOT}/src/queue -I${ROOT}/src/socket -I${ROOT}/include/usgcommon - -PROGS = ${DEST}/test_net_mod_socket ${DEST}/test_bus_stop ${DEST}/heart_beat - -DEPENDENCES = $(patsubst %, %.d, $(PROGS)) - -#LIBCOMMON=${ROOT}/lib/libusgcommon.a - -build: $(PROGS) - cp -a net_mod_socket.sh ${DEST} - cp -a heart_beat.sh ${DEST} - - -clean: - rm -f $(PROGS) $(DEPENDENCES) $(TEMPFILES) - -# $(LIBCOMMON): -# @(cd $(ROOT)/common && $(MAKE)) - --include $(DEPENDENCES) -include $(ROOT)/Make.common.inc - - - diff --git a/test_nng/Makefile b/test_nng/Makefile deleted file mode 100644 index 8828bda..0000000 --- a/test_nng/Makefile +++ /dev/null @@ -1,36 +0,0 @@ - -ROOT := .. -PLATFORM=$(shell $(ROOT)/systype.sh) -include $(ROOT)/Make.defines.$(PLATFORM) - -#RPATH += -Wl,-rpath=${ROOT}/lib -# 寮�婧愬伐鍏峰寘璺緞 -LDDIR += -L./lib - -#-lusgcommon -# 寮�婧愬伐鍏峰寘 -LDLIBS += -lnng -lpthread - -#-I$(ROOT)/include/usgcommon -INCLUDES += -I./include - -PROGS = test_nng - -DEPENDENCES = $(patsubst %, %.d, $(PROGS)) - -#LIBCOMMON=${ROOT}/lib/libusgcommon.a - -build: $(PROGS) - - -clean: - rm -f $(PROGS) $(DEPENDENCES) $(TEMPFILES) - -# $(LIBCOMMON): -# @(cd $(ROOT)/common && $(MAKE)) - --include $(DEPENDENCES) -include $(ROOT)/Make.common.inc - - - diff --git a/test_queue/Makefile b/test_queue/Makefile deleted file mode 100755 index 55e6e8a..0000000 --- a/test_queue/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Makefile for common library. -# -ROOT=.. -LDLIBS+=-Wl,-rpath=$(ROOT)/lib:$(ROOT)/build/lib -# 寮�婧愬伐鍏峰寘璺緞 -LDDIR += -L$(ROOT)/build/lib -# 寮�婧愬伐鍏峰寘 -LDLIBS += -lshm_queue -lusgcommon -lpthread - -INCLUDE += -I$(ROOT)/build/include -I$(ROOT)/include/usgcommon - -PLATFORM=$(shell $(ROOT)/systype.sh) -include $(ROOT)/Make.defines.$(PLATFORM) - - -PROGS = test_queue - -build: $(PROGS) - -# test1: $(LIBCOMMON) - -# 濡傛灉鍖匒 寮曠敤鍖匓锛� B 瑕佹斁鍦� A 鍚庨潰 - -clean: - rm -f $(TEMPFILES) $(PROGS) diff --git a/test_socket/Makefile b/test_socket/Makefile deleted file mode 100644 index 9e3e296..0000000 --- a/test_socket/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -ROOT := .. -PLATFORM=$(shell $(ROOT)/systype.sh) -include $(ROOT)/Make.defines.$(PLATFORM) - -RPATH += -Wl,-rpath=$(ROOT)/lib:$(DEST)/lib -# 寮�婧愬伐鍏峰寘璺緞 -LDDIR += -L${DEST}/lib - -# 寮�婧愬伐鍏峰寘 -#-lusgcommon -LDLIBS += -lshm_queue -lpthread -lusgcommon - -INCLUDES += -I${ROOT}/src -I${ROOT}/src/queue -I${ROOT}/src/socket -I${ROOT}/src/common/include -I$(ROOT)/include/usgcommon - - -PROGS = ${DEST}/dgram_mod_bus ${DEST}/dgram_mod_survey ${DEST}/dgram_mod_req_rep ${DEST}/test_timeout ${DEST}/test_open_close - -DEPENDENCES = $(patsubst %, %.d, $(PROGS)) - -#LIBCOMMON=${ROOT}/lib/libusgcommon.a - -build: $(PROGS) - - -# class -#$(DEST)/kucker : kucker.c - - -clean: - rm -f $(PROGS) $(DEPENDENCES) $(TEMPFILES) - -# $(LIBCOMMON): -# @(cd $(ROOT)/common && $(MAKE)) - --include $(DEPENDENCES) -include $(ROOT)/Make.common.inc - - - -- Gitblit v1.8.0