Files
wassembly/makefile

30 lines
555 B
Makefile

CC = g++
CFLAGS = -g -std=c++17 -Wall -Iinclude #-Werror
LFLAGS = #-lsfml-graphics -lsfml-window -lsfml-system
CPPS = $(shell find src/ -name '*.cpp')
OBJS = $(patsubst src/%.cpp, build/%.o, ${CPPS})
DEPS = $(patsubst src/%.cpp, build/%.d, ${CPPS})
BINARY = bin/wassembly
.PHONY: all check clean
all: ${BINARY}
check: ${BINARY}
./$< ./bin/example.wasm
clean:
-rm -rf build ./${BINARY}
${BINARY}: ${OBJS}
mkdir -p ${@D}
${CC} ${CFLAGS} $^ ${LFLAGS} -o $@
build/%.o: src/%.cpp
mkdir -p ${@D}
${CC} ${CFLAGS} -MMD -c $< -o $@
-include ${DEPS}