From f439ae911923ee70937592b1ee535e8e8e133808 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Wed, 6 Mar 2019 15:04:57 +0100 Subject: Directory updates Moved source files to ./src and exmaple and test to ./example Updated Makefile and .doxygen to use those directorys --- Makefile | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ee0f6d2..0fec7c2 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ DEBUGFLAGS = -Wall -g -std=c++11 LDFLAGS = SONAME = engine BUILDDIR = build +SOURCEDIR = src #VERSION VERSION = 0 PATCHLEVEL = 4 @@ -11,22 +12,28 @@ OUTPUT = lib$(SONAME).so.$(VERSION).$(PATCHLEVEL) OBJ = cObject.o cObjectHandler.o cRender.o cInput.o cWiremesh.o -build: genversion $(OBJ) - mkdir -p $(BUILDDIR) - mkdir -p $(BUILDDIR)/lib - mkdir -p $(BUILDDIR)/inc +build: dir genversion $(OBJ) $(CC) $(CFLAGS) -o $(BUILDDIR)/lib/$(OUTPUT) $(OBJ) $(LDFLAGS) -Wl,-soname=lib$(SONAME).so.$(VERSION) ln -sf $(OUTPUT) $(BUILDDIR)/lib/lib$(SONAME).so.$(VERSION) ln -sf $(OUTPUT) $(BUILDDIR)/lib/lib$(SONAME).so - cp c*.h $(BUILDDIR)/inc - cp version.h $(BUILDDIR)/inc + cp src/c*.h $(BUILDDIR)/inc + cp src/version.h $(BUILDDIR)/inc + +dir: + mkdir -p $(BUILDDIR) + mkdir -p $(BUILDDIR)/lib + mkdir -p $(BUILDDIR)/inc + -%.o: %.cpp +%.o: $(SOURCEDIR)/%.cpp @echo @echo Building $< @echo ============== @echo $(CC) $(CFLAGS) -c $< + +%.o: example/%.cpp + $(CC) $(CFLAGS) -I$(SOURCEDIR) -c $< all: clean build @@ -34,7 +41,7 @@ all: clean build .PHONY: clean clean: - rm -df $(OBJ) test.o version.h + rm -df $(OBJ) test.o src/version.h rm -Rdf $(BUILDDIR)/lib $(BUILDDIR)/inc $(BUILDDIR)/test doc/ run: gentest @@ -45,15 +52,15 @@ memleak: gentest genversion: @echo Building Version - @echo "//Generated by MAKEFILE. DO NOT Edit." > version.h - @echo "#pragma once" >> version.h - @echo "#define VERSION $(VERSION)" >> version.h - @echo "#define PATCHLEVEL $(PATCHLEVEL)" >> version.h - @echo "#define VERSTRING \"`git describe`\"" >> version.h - @echo "#define DATE \"`date +'%d.%m.20%y'`\"" >> version.h - @echo "#define TIME \"`date +'%H:%M:%S'`\"" >> version.h + @echo "//Generated by MAKEFILE. DO NOT Edit." > src/version.h + @echo "#pragma once" >> src/version.h + @echo "#define VERSION $(VERSION)" >> src/version.h + @echo "#define PATCHLEVEL $(PATCHLEVEL)" >> src/version.h + @echo "#define VERSTRING \"`git describe`\"" >> src/version.h + @echo "#define DATE \"`date +'%d.%m.20%y'`\"" >> src/version.h + @echo "#define TIME \"`date +'%H:%M:%S'`\"" >> src/version.h -gentest: genversion test.o $(OBJ) +gentest: build test.o mkdir -p $(BUILDDIR)/test $(CC) $(DEBUGFLAGS) -o $(BUILDDIR)/test/test test.o $(OBJ) $(LDFLAGS) -- cgit v1.2.3