Skip to content

Commit

Permalink
Rename to BML
Browse files Browse the repository at this point in the history
  • Loading branch information
Bee Bussell committed Sep 8, 2021
1 parent 89663f9 commit b8ddaef
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 31 deletions.
34 changes: 17 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ TESTOBJDIR = tests/obj
#CC specifies which compiler we're using
CC = g++

bSDLsrc = $(wildcard src/bSDL/*.cpp) \
BMLsrc = $(wildcard src/BML/*.cpp) \
$(wildcard src/bData/*.cpp) \
$(wildcard src/bTexture/*.cpp) \
$(wildcard src/bWindow/*.cpp) \
$(wildcard src/bEvent/*.cpp) \
$(wildcard src/bSound/*.cpp)

bSDLobj := $(notdir $(bSDLsrc))
bSDLobj := $(addprefix $(OBJDIR)/, $(bSDLobj))
bSDLobj := $(bSDLobj:.cpp=.o)
BMLobj := $(notdir $(BMLsrc))
BMLobj := $(addprefix $(OBJDIR)/, $(BMLobj))
BMLobj := $(BMLobj:.cpp=.o)


testsrc = $(wildcard tests/src/*.cpp)
Expand All @@ -30,7 +30,7 @@ CFLAGS := -Wall -Wextra -std=c++17
IFLAGS := -Isrc

#LFLAGS specifies the libraries we're linking against
LFLAGS := -lSDL2 -lSDL2_image -lSDL2_mixer bin/libBSDL.a
LFLAGS := -lSDL2 -lSDL2_image -lSDL2_mixer bin/libBML.a

#WFLAGS specifies that we know what we are doing with ar
WFLAGS := -no_warning_for_no_symbols
Expand All @@ -54,26 +54,26 @@ endif

#all rule for just compiling everything
.PHONY: all
all: bSDL build Tests
all: BML build Tests


.PHONY: bSDL
bSDL: $(bSDLobj)
.PHONY: BML
BML: $(BMLobj)

#Tests for only compiling tests
.PHONY: Tests
Tests: bSDL build SoundTest TextureTest EventTest WindowTest
Tests: BML build SoundTest TextureTest EventTest WindowTest

.PHONY: build
build: $(bSDLobj)
@printf "\n$(bold)----------Building bSDL LIB File----------------$(sgr0)\n"
ar rc bin/libBSDL.a $(bSDLobj)
ranlib bin/libBSDL.a
build: $(BMLobj)
@printf "\n$(bold)----------Building BML LIB File----------------$(sgr0)\n"
ar rc bin/libBML.a $(BMLobj)
ranlib bin/libBML.a

.PHONY: install
install: build
@printf "\n$(bold)----------INSTALLING LIBRARY TO DIRECTORY-------$(sgr0)\n"
sudo install -m 644 bin/libBSDL.a $(LPATH)
sudo install -m 644 bin/libBML.a $(LPATH)

SoundTest: tests/obj/soundTest.o build
@printf "\n$(bold)----------COMPILING TEST FILE: $@----------$(sgr0)\n"
Expand All @@ -91,9 +91,9 @@ WindowTest: tests/obj/windowTest.o build
@printf "\n$(bold)----------COMPILING TEST FILE: $@----------$(sgr0)\n"
$(CC) $< $(CFLAGS) $(LFLAGS) -o tests/bin/$@

# Rules for bSDL obj files
# Rules for BML obj files
$(OBJDIR)/%.o: src/*/%.cpp
@printf "\n$(bold)----------COMPILING BSDL FILE: $(notdir $@)----------$(sgr0)\n"
@printf "\n$(bold)----------COMPILING BML FILE: $(notdir $@)----------$(sgr0)\n"
$(CC) $^ $(CFLAGS) $(IFLAGS) -c -o $@

# Rules for test obj files
Expand All @@ -104,7 +104,7 @@ $(TESTOBJDIR)/%.o: tests/src/%.cpp
.PHONY: clean
clean:
@printf "\n$(bold)----------REMOVING PREVIOUS BUILDS----------$(sgr0)\n"
rm -f $(bSDLobj)
rm -f $(BMLobj)
rm -f $(testobj)
rm -f bin/*
rm -f a.out tests/bin/*
2 changes: 1 addition & 1 deletion src/bSDL/bSDL.cpp → src/BML/BML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// Sep 8, 2021
// Just for Static Library

#include "bSDL.h"
#include "BML.h"
4 changes: 2 additions & 2 deletions src/bSDL/bSDL.h → src/BML/BML.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifndef bSDL_h
#define bSDL_h
#ifndef BML_h
#define BML_h

#include "bData/bRect.h"
#include "bTexture/bTexture.h"
Expand Down
4 changes: 2 additions & 2 deletions src/bWindow/bWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <SDL2/SDL_image.h>
#include <stdint.h>
#include <string>
#include "../bData/bRect.h"
#include "../bTexture/bTexture.h"
#include "bData/bRect.h"
#include "bTexture/bTexture.h"

class bWindow {

Expand Down
2 changes: 1 addition & 1 deletion tests/src/eventTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <iostream>
#include <stdint.h>

#include <bSDL/bSDL.h>
#include <BML/BML.h>



Expand Down
4 changes: 2 additions & 2 deletions tests/src/soundTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <iostream>
#include <stdint.h>
#include <bSDL/bSDL.h>
#include <BML/BML.h>


int main() {
Expand All @@ -31,7 +31,7 @@ int main() {
bSound::loadMUS("../resources/BLUE-Compress.wav");
bSound::playMUS(5);

//bTexture blueSquare = window->initTexture("/home/bee/Development/bSDL/tests/resources/blueSquare.png", src);
//bTexture blueSquare = window->initTexture("/home/bee/Development/BML/tests/resources/blueSquare.png", src);
bTexture blueSquare = window->initTexture("../resources/blueSquare.png", src);

double vol = .5;
Expand Down
7 changes: 2 additions & 5 deletions tests/src/textureTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
#include <iostream>
#include <stdint.h>

#include <bSDL/bSDL.h>
#include <filesystem>
namespace fs = std::filesystem;

#include <BML/BML.h>

int main() {

Expand All @@ -25,7 +22,7 @@ int main() {
bRect src = {10,10,320,240};


//bTexture blueSquare = window->initTexture("/home/bee/Development/bSDL/tests/resources/blueSquare.png", src);
//bTexture blueSquare = window->initTexture("/home/bee/Development/BML/tests/resources/blueSquare.png", src);
bTexture blueSquare = window->initTexture("../resources/blueSquare.png", src);

while(run) {
Expand Down
2 changes: 1 addition & 1 deletion tests/src/windowTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <iostream>
#include <string>
#include <stdint.h>
#include <bSDL/bSDL.h>
#include <BML/BML.h>

int main() {

Expand Down

0 comments on commit b8ddaef

Please sign in to comment.