Jump to content

Recommended Posts

Hello guys,

 

i want to know how i can compile the game & db source. I had then bought by someone the source, but there was no compile.sh or something in there. The seller is also no longer be reached.

So i have no compile.sh, build.sh or something like this, but i have there a lot of MAKEFILEs.

 

I did the following:

 

cd:/ /usr/src/metin2source/game/

and then i write : gmake

and then i get this: 

NeW4g.png

 

if i write : gmake clean

then i get this:

rm -f .obj/* ../bin/metin2source_game*

 

if i write: gmake -j20 

then i get this:

norlc.png

 

 

I have no idea how i can compile the source. Please help me. Did i need the compile.sh, build.sh and build_db.sh or did i need the include and lib files? What is the problem? I think the .sh files are not the problem, because the seller use also no .sh files and it works for him.

 

Btw: Can i compile the source without freebsd? I have freebsd 9.x ..  Is it possible to compile only with visual studio 2013?

Edited by Metin2 Dev
Core X - External 2 Internal

I dont know which branch this is, but the makefiles looks so:

 

Makefile from the main source folder:

.PHONY: all libs liblua liblzo libsql libgame libpoly libthecore game db clean rebuild

COMMON_FLAGS = -Wall -Wextra -pedantic -Wno-gnu-zero-variadic-macro-arguments -Wno-variadic-macros -MMD 

CC  ?= clang34
CXX ?= clang++34

ifneq ($(NODEBUG), ON)
    COMMON_FLAGS += -ggdb3
endif

ifeq ($(OPTIMIZE), ON)
    COMMON_FLAGS += -Os
endif

ifeq ($(NOWARNINGS), ON)
    COMMON_FLAGS += -w
endif

ifeq ($(CXX), clang++)
    COMMON_FLAGS += -ferror-limit=0    
    ifeq ($(COLOROUT), ON)
    	COMMON_FLAGS += -fcolor-diagnostics
    endif
endif

LDFLAGS  = 

ifeq ($(LTO), ON)
    COMMON_FLAGS += -flto
ifeq ($(CXX), g++)
    COMMON_FLAGS += -ffat-lto-objects
endif
    LDFLAGS      += -flto -O3 
endif

CFLAGS   = $(COMMON_FLAGS) -std=c11 
CXXFLAGS = $(COMMON_FLAGS) -std=c++1y

export CC CXX CFLAGS CXXFLAGS LDFLAGS

all: libs db game

libs: liblzo libsql libgame libpoly libthecore liblua

libsql:
	$(MAKE) -C $@

libgame:
	$(MAKE) -C $@

libpoly:
	$(MAKE) -C $@ 

libthecore:
	$(MAKE) -C $@

liblzo:
	$(MAKE) -C $@

liblua:
	$(MAKE) -C $@

game: libthecore libgame libpoly libsql liblua liblzo
	$(MAKE) -C $@

db: libgame libpoly libsql libthecore
	$(MAKE) -C $@

clean:
	$(MAKE) -C libsql clean
	$(MAKE) -C libgame clean
	$(MAKE) -C libpoly clean
	$(MAKE) -C libthecore clean
	$(MAKE) -C liblzo clean
	$(MAKE) -C liblua clean
	$(MAKE) -C db clean
	$(MAKE) -C game clean

dep:
	$(MAKE) -C libsql dep
	$(MAKE) -C libgame dep
	$(MAKE) -C libpoly dep
	$(MAKE) -C libthecore dep
	$(MAKE) -C db dep
	$(MAKE) -C game dep

rebuild: | clean all

 

Makefile from the db folder:

BINDIR = ../bin
INCDIR = include
LIBDIR =
OBJDIR = .obj
SRCDIR = src

$(shell if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi)
$(shell if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); fi)

TARGET = $(BINDIR)/metin2source_db

CXXFLAGS += -pipe -fno-rtti -fno-exceptions -D_THREAD_SAFE 
LDFLAGS  +=

INCDIRS  += -I$(INCDIR) -I../include -I/usr/local/include
LIBDIRS  += -L../lib

LIBS      = -lpthread \
	    -lmysqlclient \
	    -lgame -lpoly -lsql -lthecore

ifeq ($(shell uname), FreeBSD)
    LIBDIRS += -L/usr/local/lib/mysql -L/usr/local/lib
    LIBS    += 
else
    LIBS    += -lbsd
endif

SRCS = $(shell ls $(SRCDIR)/*.cpp | sort -f)
OBJS = $(SRCS:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)

default: $(TARGET)

$(TARGET): $(OBJS)
	$(CXX) $(LDFLAGS) $(LIBDIRS) $(OBJS) $(LIBS) -o $(TARGET)

-include $(OBJS:.o=.d)

$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
	$(CXX) $(CXXFLAGS) $(INCDIRS) -x c++ -c $< -o $@

clean:
	rm -f $(OBJDIR)/* $(BINDIR)/metin2source_db

Makefile from the game folder:

BINDIR  = ../bin
INCDIR  = include
LIBDIR  =
OBJDIR  = .obj
SRCDIR  = src

$(shell if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi)
$(shell if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); fi)

TARGET = $(BINDIR)/metin2source_game

CXXFLAGS += -pipe -fexceptions -fstack-protector-all # -D_THREAD_SAFE
LDFLAGS  +=

INCDIRS  += -I$(INCDIR) -I../include
LIBDIRS  += -L../lib

LIBS      = -lpthread \
	    -lIL \
	    -lmysqlclient \
            -lboost_system \
	    -lcrypto -lcryptopp \
	    -llua -llzo -lgame -lpoly -lsql -lthecore

ifeq ($(shell uname), FreeBSD)
    INCDIRS += -I/usr/local/include 
    LIBDIRS += -L/usr/local/lib/mysql -L/usr/local/lib
    LIBS    += -lmd
else
    LIBS    += -lbsd
endif


SRCS = $(shell ls $(SRCDIR)/*.cpp | sort -f) #$(wildcard $(SRCDIR)/*.c++)

ifneq ($(shell uname), FreeBSD)
    SRCS := $(filter-out src/FileMonitor_FreeBSD.cpp,$(SRCS))
endif

OBJS = $(SRCS:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)

default: $(TARGET)

$(TARGET): $(OBJS)
	$(CXX) $(LDFLAGS) $(LIBDIRS) $(OBJS) $(LIBS) -o $(TARGET)

-include $(OBJS:.o=.d)

$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
	$(CXX) $(CXXFLAGS) $(INCDIRS) -x c++ -c $< -o $@

clean:
	rm -f $(OBJDIR)/* $(BINDIR)/metin2source_game*

Never mind misread

Do you mean the Makefile files are correct?

No i though you didn't know the command XD.

Command for compiling? Yes that is true. I dont know it, but i think gmake -j20 is the command. If you know the command then say it to me please.

Edited by Sarahx3

Never mind misread

Do you mean the Makefile files are correct?

No i though you didn't know the command XD.

Command for compiling? Yes that is true. I dont know it, but i think gmake -j20 is the command. If you know the command then say it to me please.

Try gmake all or gmake only

Never mind misread

Do you mean the Makefile files are correct?

No i though you didn't know the command XD.

Command for compiling? Yes that is true. I dont know it, but i think gmake -j20 is the command. If you know the command then say it to me please.

Try gmake all or gmake only

gmake : NeW4g.png

gmake all: iCQZc.png

Edited by Metin2 Dev
Core X - External 2 Internal

Never mind misread

Do you mean the Makefile files are correct?

No i though you didn't know the command XD.

Command for compiling? Yes that is true. I dont know it, but i think gmake -j20 is the command. If you know the command then say it to me please.

Try gmake all or gmake only

gmake : NeW4g.png

gmake all: iCQZc.png

Then i don't know

Edited by Metin2 Dev
Core X - External 2 Internal

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.