diff options
Diffstat (limited to 'extern')
-rw-r--r-- | extern/verse/Makefile | 22 | ||||
-rw-r--r-- | extern/verse/dist/Makefile | 85 |
2 files changed, 13 insertions, 94 deletions
diff --git a/extern/verse/Makefile b/extern/verse/Makefile index 769bbe4d09c..21620dcd2ce 100644 --- a/extern/verse/Makefile +++ b/extern/verse/Makefile @@ -28,8 +28,12 @@ # Contributor(s): Jiri Hnidek # # ***** END GPL/BL DUAL LICENSE BLOCK ***** +LIBNAME = verse +SOURCEDIR = extern/$(LIBNAME) +DIR = $(OCGDIR)/$(SOURCEDIR) +DIRS = dist -include nan_definitions.mk +include nan_subdirs.mk DISTDIR = dist CP = ../../intern/tools/cpifdiff.sh @@ -38,23 +42,15 @@ ifeq ($(OS),windows) EXT = .exe endif -all: - $(MAKE) -C $(DISTDIR) - -# fake debug target -debug: - -install: all +install: all debug @[ -d $(NAN_VERSE) ] || mkdir -p $(NAN_VERSE) @[ -d $(NAN_VERSE)/include ] || mkdir -p $(NAN_VERSE)/include @[ -d $(NAN_VERSE)/lib ] || mkdir -p $(NAN_VERSE)/lib @[ -d $(OCGDIR)/bin ] || mkdir -p $(OCGDIR)/bin @$(CP) $(DISTDIR)/*.h $(NAN_VERSE)/include - @$(CP) $(DISTDIR)/libverse.a $(NAN_VERSE)/lib - @$(CP) $(DISTDIR)/verse$(EXT) $(OCGDIR)/bin + @$(CP) $(DIR)/libverse.a $(NAN_VERSE)/lib ifeq ($(OS),darwin) ranlib $(NAN_VERSE)/lib/libverse.a endif - -clean: - $(MAKE) -C $(DISTDIR) clean + $(CC) $(LDFLAGS) -o $(DIR)/verse$(EXT) $(DIR)/libverse.a $(LIBS) $(SLIBS) $(LLIBS) $(DADD) $(LOPTS) + @$(CP) $(DIR)/verse$(EXT) $(OCGDIR)/bin diff --git a/extern/verse/dist/Makefile b/extern/verse/dist/Makefile index 7dbcf4708db..69b5590b2bc 100644 --- a/extern/verse/dist/Makefile +++ b/extern/verse/dist/Makefile @@ -7,86 +7,9 @@ # and running other C files (this is the protocol definition). # -CC ?= gcc -CFLAGS ?= "-I$(shell pwd)" -Wall -Wpointer-arith -Wno-unused-parameter -ansi -g # -pg -O2 -finline-functions -LDFLAGS ?= # -pg +LIBNAME = verse +DIR = $(OCGDIR)/extern/$(LIBNAME) -AR ?= ar -ARFLAGS = rus -RANLIB ?= ranlib +include nan_compile.mk -TARGETS = libverse.a verse - -.PHONY: all clean cleanprot - -# Automatically generated protocol things. -PROT_DEF = $(wildcard v_cmd_def_*.c) -PROT_TOOL = v_cmd_gen.c $(PROT_DEF) -PROT_OUT = v_gen_pack_init.c v_gen_unpack_func.h verse.h \ - $(patsubst v_cmd_def_%.c,v_gen_pack_%_node.c, $(PROT_DEF)) - -# The API implementation is the protocol code plus a few bits. -LIBVERSE_SRC = $(PROT_OUT) v_bignum.c v_cmd_buf.c v_connect.c \ - v_connection.c v_connection.h v_encryption.c \ - v_func_storage.c v_internal_verse.h v_man_pack_node.c \ - v_network.c v_network.h v_network_in_que.c v_network_out_que.c \ - v_pack.c v_pack.h v_pack_method.c v_prime.c v_randgen.c v_util.c \ - verse_ms.c - -LIBVERSE_OBJ = $(patsubst %h,, $(LIBVERSE_SRC:%.c=%.o)) - -# The server is a simple 1:1 mapping, so just use wildcards. -VERSE_SRC = $(wildcard vs_*.c) -VERSE_OBJ = $(VERSE_SRC:%.c=%.o) - -# ----------------------------------------------------- - -all: $(TARGETS) - -verse: $(VERSE_OBJ) libverse.a - $(CC) $(LDFLAGS) -o $@ $^ - -libverse.a: libverse.a($(LIBVERSE_OBJ)) - -# ----------------------------------------------------- - -# Here are the automatically generated pieces of the puzzle. -# Basically, we generate v_gen_pack_X_node.c files by compiling -# the v_cmd_def_X.c files together with some driver glue and -# running the result. -# - -# The autogen outputs all depend on the tool. -$(PROT_OUT): mkprot - ./mkprot - -# Build the protocol maker, from the definitions themselves. -mkprot: $(PROT_TOOL) verse_header.h - $(CC) -DV_GENERATE_FUNC_MODE -o $@ $(PROT_TOOL) - -# Clean away all the generated parts of the protocol implementation. -cleanprot: clean - rm -f mkprot $(PROT_OUT) - -# ----------------------------------------------------- - -clean: - rm -f *.o $(TARGETS) mkprot - -# ----------------------------------------------------- - -# Utter ugliness to create release archives. Needs to improve, but should work for a while. -dist: - RELEASE=$$( \ - R=`grep V_RELEASE_NUMBER verse.h | tr -s ' \t' | tr -d '"\r' | cut -d' ' -f3` ; \ - P=`grep V_RELEASE_PATCH verse.h | tr -s ' \t' | tr -d '"\r' | cut -d' ' -f3` ; \ - L=`grep V_RELEASE_LABEL verse.h | tr -s ' \t' | tr -d '"\r' | cut -d' ' -f3` ; echo r$${R}p$$P$$L ) ; \ - if [ $$RELEASE ]; then ( \ - rm -rf /tmp/verse; \ - mkdir -p /tmp/verse; \ - cp -a * /tmp/verse; \ - cd /tmp && zip verse-$$RELEASE.zip -r verse -x 'verse/*CVS*' -x 'verse/.*' ; \ - ); mv /tmp/verse-$$RELEASE.zip . \ - ;else \ - echo "Couldn't auto-set RELEASE from verse.h, something is fishy" \ - ;fi +# TARGETS = verse |