From 1f7ca9fd3964481318bbaddfb39acc5de8c7d65d Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sun, 20 Sep 2009 23:10:31 +0200 Subject: Basic makefile structure; making the project at least compilable. --- Utils/Makefile | 13 +++++++++++++ Utils/allocator.h | 13 +++++++++++++ Utils/log.cpp | 0 Utils/log.h | 8 ++++++++ 4 files changed, 34 insertions(+) create mode 100644 Utils/Makefile create mode 100644 Utils/allocator.h create mode 100644 Utils/log.cpp create mode 100644 Utils/log.h (limited to 'Utils') diff --git a/Utils/Makefile b/Utils/Makefile new file mode 100644 index 0000000..1b001a8 --- /dev/null +++ b/Utils/Makefile @@ -0,0 +1,13 @@ +TARGET = Utils.a + +SRCS = \ +log.cpp \ + +CPPFLAGS = -I. + +include ../Makefile.cfg + +$(TARGET): $(OBJS) + $(AR) $@ $^ + +-include $(DEPS) diff --git a/Utils/allocator.h b/Utils/allocator.h new file mode 100644 index 0000000..8b0fdb6 --- /dev/null +++ b/Utils/allocator.h @@ -0,0 +1,13 @@ +#ifndef __ALLOCATOR_H__ +#define __ALLOCATOR_H__ + +#include + +template +class Allocator { + public: + static T * alloc(int n) { return (T*) calloc(n, sizeof(T)); }; + static void free(T * & ptr) { free(ptr); ptr = 0; } +}; + +#endif diff --git a/Utils/log.cpp b/Utils/log.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Utils/log.h b/Utils/log.h new file mode 100644 index 0000000..33b03d7 --- /dev/null +++ b/Utils/log.h @@ -0,0 +1,8 @@ +#ifndef __LOG_H__ +#define __LOG_H__ + +#define LOG(...) +#define CONSOLE +#define ERROR + +#endif -- cgit v1.2.3