Compiling works for Brainstorm

This commit is contained in:
John Alanbrook 2022-01-21 17:26:22 +00:00
parent 34d0565886
commit 2c88a01cfd
11 changed files with 20 additions and 16 deletions

View file

@ -9,7 +9,7 @@ endif
UNAME_P := $(shell uname -m) UNAME_P := $(shell uname -m)
#CC specifies which compiler we're using #CC specifies which compiler we're using
CC = clang -x c --std=c99 CC = clang
CXX = clang++ CXX = clang++
ifeq ($(DEBUG), 1) ifeq ($(DEBUG), 1)
@ -23,12 +23,13 @@ BUILDDIR := ./obj
objprefix = ./obj objprefix = ./obj
DIRS := engine pinball editor brainstorm DIRS := engine pinball editor brainstorm
ETP := ./source/engine/thirdparty/
# All other sources # All other sources
esrcs := $(shell find ./source/engine -name '*.c*') esrcs := $(shell find ./source/engine -name '*.c*')
esrcs := $(filter-out %sqlite3.c %shell.c %s7.c, $(esrcs)) esrcs := $(filter-out %sqlite3.c %shell.c, $(esrcs))
eheaders := $(shell find ./source/engine -name '*.h') eheaders := $(shell find ./source/engine -name '*.h')
edirs := $(shell find ./source/engine -type d) edirs := $(addprefix $(ETP), Chipmunk2D/include bitmap-outliner cgltf enet/include pl_mpeg s7 sqlite3 stb) ./source/engine # $(shell find ./source/engine -type d)
edirs := $(filter-out %docs %doc %include% %src %examples , $(edirs)) edirs := $(filter-out %docs %doc %include% %src %examples , $(edirs))
eobjects := $(sort $(patsubst .%.cpp, $(objprefix)%.o, $(filter %.cpp, $(esrcs))) $(patsubst .%.c, $(objprefix)%.o, $(filter %.c, $(esrcs)))) eobjects := $(sort $(patsubst .%.cpp, $(objprefix)%.o, $(filter %.cpp, $(esrcs))) $(patsubst .%.c, $(objprefix)%.o, $(filter %.c, $(esrcs))))
@ -90,17 +91,18 @@ yuginec := ./source/engine/yugine.c
.SECONARY: $(eobjects) .SECONARY: $(eobjects)
engine: engine.a engine: libengine.a
@echo Linking engine @echo Linking engine
$(CXX) $(yuginec) -DGLEW_STATIC $(includeflag) $(LIBPATH) $(LINKER_FLAGS) $(LELIBS) -o yugine $(CXX) $(yuginec) -DGLEW_STATIC $(includeflag) $(LIBPATH) $(LINKER_FLAGS) $(LELIBS) -o yugine
engine.a: $(eobjects) libengine.a: $(eobjects)
@echo Making library engine.a @echo Making library engine.a
@ar -rv libengine.a $(eobjects) @ar -r libengine.a $(eobjects)
brainstorms: engine.a $(bsobjects) xbrainstorm: libengine.a $(bsobjects)
@echo Making brainstorm @echo Making brainstorm
$(CXX) $(bsobjects) -DGLEW_STATIC $(includeflag) $(LIBPATH) $(LINKER_FLAGS) $(LELIBS) -o $@ $(CXX) $(bsobjects) -DGLEW_STATIC $(includeflag) $(LIBPATH) $(LINKER_FLAGS) $(LELIBS) -o $@
mv xbrainstorm brainstorm/xbrainstorm
$(objprefix)/%.o:%.cpp $(objprefix)/%.o:%.cpp
@mkdir -p $(@D) @mkdir -p $(@D)

View file

@ -18,7 +18,7 @@ extern "C" {
#include "level.h" #include "level.h"
#include "texture.h" #include "texture.h"
#include "sprite.h" #include "sprite.h"
#include <chipmunk.h> #include <chipmunk/chipmunk.h>
#include "math.h" #include "math.h"
#include <GL/glew.h> #include <GL/glew.h>
#include <ftw.h> #include <ftw.h>

View file

@ -1,7 +1,7 @@
#ifndef EDITOR_H #ifndef EDITOR_H
#define EDITOR_H #define EDITOR_H
#include "config.h" #include <config.h>
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include <stdbool.h> #include <stdbool.h>
#include "resources.h" #include "resources.h"

View file

@ -205,7 +205,7 @@ void phys2d_edgeaddvert(struct phys2d_edge *edge)
#include "debugdraw.h" #include "debugdraw.h"
#include "gameobject.h" #include "gameobject.h"
#include <math.h> #include <math.h>
#include <chipmunk_unsafe.h> #include <chipmunk/chipmunk_unsafe.h>
void phys2d_applycircle(struct phys2d_circle *circle) void phys2d_applycircle(struct phys2d_circle *circle)
{ {

View file

@ -1,7 +1,7 @@
#ifndef TWODPHYSICS_H #ifndef TWODPHYSICS_H
#define TWODPHYSICS_H #define TWODPHYSICS_H
#include <chipmunk.h> #include <chipmunk/chipmunk.h>
struct mGameObject; struct mGameObject;

View file

@ -1,4 +1,4 @@
#include <3dphysics.h> #include "3dphysics.h"
/* /*
btDefaultCollisionConfiguration *collisionConfig { btDefaultCollisionConfiguration *collisionConfig {

View file

@ -8,7 +8,7 @@
#include "vec.h" #include "vec.h"
#include "input.h" #include "input.h"
#include <string.h> #include <string.h>
#include <chipmunk.h> #include <chipmunk/chipmunk.h>
struct vec *gameobjects = NULL; struct vec *gameobjects = NULL;
struct mGameObject *updateGO = NULL; struct mGameObject *updateGO = NULL;

View file

@ -6,7 +6,7 @@
#include "transform.h" #include "transform.h"
#include "config.h" #include "config.h"
#include <stdbool.h> #include <stdbool.h>
#include <chipmunk.h> #include <chipmunk/chipmunk.h>
struct mShader; struct mShader;
struct mSprite; struct mSprite;

View file

@ -1 +1 @@
#include <gizmo.h> #include "gizmo.h"

View file

@ -1,4 +1,4 @@
#include <light.h> #include "light.h"
#include <stdbool.h> #include <stdbool.h>

View file

@ -28,9 +28,11 @@ void registry_init()
register_component("2D Edge", sizeof(struct phys2d_edge), &Make2DEdge, register_component("2D Edge", sizeof(struct phys2d_edge), &Make2DEdge,
&phys2d_dbgdrawedge, &edge_gui, &phys2d_edgeinit, &phys2d_dbgdrawedge, &edge_gui, &phys2d_edgeinit,
NULL); NULL);
/*
register_component("Flipper", sizeof(struct flipper), register_component("Flipper", sizeof(struct flipper),
&pinball_flipper_make, NULL, &pinball_flipper_gui, &pinball_flipper_make, NULL, &pinball_flipper_gui,
&pinball_flipper_init, &pinball_flipper_update); &pinball_flipper_init, &pinball_flipper_update);
*/
} }
void register_component(const char *name, size_t size, void register_component(const char *name, size_t size,