Skip to content
Snippets Groups Projects
Unverified Commit 61213816 authored by clayton craft's avatar clayton craft Committed by GitHub
Browse files

tidy up source code and build objects (#69)

Note, this will break packaging of this application.
parent 2a89c8b2
No related branches found
No related tags found
No related merge requests found
/osk-sdl
/go.sh
/.vscode/
/*.o
/bin
/obj
TARGET := osk-sdl
SDL2_CFLAGS := $(shell sdl2-config --cflags)
SDL2_LIBS := $(shell sdl2-config --libs)
......@@ -6,20 +8,30 @@ CXXFLAGS := -std=c++14 -Wall -g $(SDL2_CFLAGS)
LIBS := -lcryptsetup $(SDL2_LIBS) -lSDL2_ttf
SOURCES := ${wildcard *.cpp}
OBJECTS := $(SOURCES:%.cpp=%.o)
SRC_DIR := src
BIN_DIR := bin
OBJ_DIR := obj
SOURCES := ${wildcard $(SRC_DIR)/*.cpp}
OBJECTS := $(SOURCES:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)
all: osk-sdl
all: directories $(BIN_DIR)/$(TARGET)
%.o: %.cpp
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
@echo CC $<
@$(CXX) -c -o $@ $< $(CXXFLAGS)
osk-sdl: $(OBJECTS)
$(BIN_DIR)/$(TARGET): $(OBJECTS)
@echo LD $@
@$(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS)
.PHONY: clean
.PHONY: directories
clean:
-rm -fv *.o osk-sdl
-rm -rfv $(OBJ_DIR) $(BIN_DIR)
directories:
@mkdir -p ./{bin,obj}
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment