Created server shell
This commit is contained in:
@@ -2,6 +2,7 @@ OUTDIR=out
|
||||
|
||||
all: $(OUTDIR)
|
||||
$(MAKE) -C libs
|
||||
$(MAKE) -C server
|
||||
$(MAKE) -C client
|
||||
|
||||
$(OUTDIR):
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#include "server_application.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int, char**) {
|
||||
#ifdef DEBUG
|
||||
cout << "Beginning server" << endl;
|
||||
#endif
|
||||
try {
|
||||
ServerApplication app;
|
||||
app.Init();
|
||||
app.Proc();
|
||||
app.Quit();
|
||||
}
|
||||
catch(exception& e) {
|
||||
cerr << "Fatal error: " << e.what() << endl;
|
||||
return 1;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
cout << "Clean exit" << endl;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
#config
|
||||
LIBDIR=../libs
|
||||
LIB=-lmingw32 -lSDLmain -lSDL $(LIBDIR)/out/libCodebase.a $(LIBDIR)/out/libSDL_net.a
|
||||
INCLUDES=$(LIBDIR)/Codebase $(LIBDIR)/SDL_net
|
||||
CXXFLAGS+=-std=c++11 -DDEBUG $(addprefix -I,$(INCLUDES))
|
||||
|
||||
#source
|
||||
SRC=$(wildcard *.cpp)
|
||||
|
||||
#objects
|
||||
OBJDIR=obj
|
||||
OBJ=$(addprefix $(OBJDIR)/,$(SRC:.cpp=.o))
|
||||
|
||||
#output
|
||||
OUTDIR=../out
|
||||
OUT=$(addprefix $(OUTDIR)/,server)
|
||||
|
||||
#targets
|
||||
all: $(OBJ) $(OUT)
|
||||
$(CXX) $(CXXFLAGS) -o $(OUT) $(OBJ) $(LIB)
|
||||
|
||||
$(OBJ): | $(OBJDIR)
|
||||
|
||||
$(OUT): | $(OUTDIR)
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir $(OBJDIR)
|
||||
|
||||
$(OUTDIR):
|
||||
mkdir $(OUTDIR)
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
$(RM) *.o *.a *.exe
|
||||
|
||||
rebuild: clean all
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "server_application.hpp"
|
||||
|
||||
ServerApplication::ServerApplication() {
|
||||
//
|
||||
}
|
||||
|
||||
ServerApplication::~ServerApplication() {
|
||||
//
|
||||
}
|
||||
|
||||
void ServerApplication::Init() {
|
||||
//
|
||||
}
|
||||
|
||||
void ServerApplication::Proc() {
|
||||
//
|
||||
}
|
||||
|
||||
void ServerApplication::Quit() {
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef SERVERAPPLICATION_HPP_
|
||||
#define SERVERAPPLICATION_HPP_
|
||||
|
||||
class ServerApplication {
|
||||
public:
|
||||
ServerApplication();
|
||||
~ServerApplication();
|
||||
void Init();
|
||||
void Proc();
|
||||
void Quit();
|
||||
private:
|
||||
bool running = true;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user