Initial Commit

This commit is contained in:
Xnoe 2022-08-06 06:17:31 +01:00
commit a964634a97
Signed by: xnoe
GPG Key ID: 45AC398F44F0DAFE
3 changed files with 45 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build/

39
Makefile Normal file
View File

@ -0,0 +1,39 @@
CXX = g++
CXXFLAGS = -g
LD = ld
LINKFLAGS = -lGL -lglfw
CC = gcc
CCFLAGS = -g
XNOECRAFT_CPP_SRCS = $(shell find src/ -name '*.cpp')
XNOECRAFT_C_SRCS = $(shell find src/ -name '*.c')
XNOECRAFT_RES = $(shell find res/ -type f)
XNOECRAFT_OBJS = $(patsubst src/%.cpp,build/%.o,$(XNOECRAFT_CPP_SRCS)) $(patsubst src/%.c,build/%.o,$(XNOECRAFT_C_SRCS)) $(patsubst res/%.dat,build/%.o,$(XNOECRAFT_RES))
.PHONY = all cleanbuild clean prepare
all: prepare build/xnoecraft
./build/xnoecraft
cleanbuild: clean prepare build/xnoecraft
clean:
rm -r build
prepare:
mkdir -p build
build/xnoecraft: $(XNOECRAFT_OBJS)
$(CXX) $(LINKFLAGS) -o $@ $^
build/%.o: src/%.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $<
build/%.o: src/%.c
$(CC) $(CCFLAGS) -o $@ -c $<
build/%.o: res/%.dat
$(LD) -r -b binary $< -o $@

5
src/main.cpp Normal file
View File

@ -0,0 +1,5 @@
#include <iostream>
int main() {
std::cout << "Hello, World!\n";
}