Created server shell

This commit is contained in:
Kayne Ruse
2013-06-08 01:52:19 +10:00
parent a1b248d1d7
commit 253e9ec8fc
5 changed files with 101 additions and 0 deletions
+1
View File
@@ -2,6 +2,7 @@ OUTDIR=out
all: $(OUTDIR)
$(MAKE) -C libs
$(MAKE) -C server
$(MAKE) -C client
$(OUTDIR):
+26
View File
@@ -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;
}
+38
View File
@@ -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
+21
View File
@@ -0,0 +1,21 @@
#include "server_application.hpp"
ServerApplication::ServerApplication() {
//
}
ServerApplication::~ServerApplication() {
//
}
void ServerApplication::Init() {
//
}
void ServerApplication::Proc() {
//
}
void ServerApplication::Quit() {
//
}
+15
View File
@@ -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