import: makefile for the overlay helper, now officially renamed "oh"

This commit is contained in:
Jason Andersen 2024-02-05 19:00:49 -05:00
parent 5296a2e9d6
commit b9d6fb26fd

View file

@ -0,0 +1,49 @@
#
# overlayhelper/Makefile
#
# Make and Build Variables
VPATH = source:obj
SOURCEFILES = $(wildcard source/*.cpp)
OBJFILES = $(patsubst source/%.cpp,obj/%.o,$(SOURCEFILES))
CC = clang++
INCCMD = -Isource
# List of directories to create
DIRS=obj
CFLAGS = -std=c++17 -Os -Wall -Werror
#CFLAGS = -Os -Wall -Werror -S
help:
@echo
@echo overlayhelper Makefile
@echo -------------------------------------------------
@echo build commands:
@echo make install - Compile / Install
@echo make clean - Clean intermediate/target files
@echo -------------------------------------------------
@echo
overlayhelper: $(OBJFILES)
install: overlayhelper
$(CC) -o ../oh $(OBJFILES)
# $(CC) -o ../overlayhelper $(OBJFILES) -Wl,-Map,overlayhelper.map
clean:
@echo Remove overlayhelper
$(shell if exist overlayhelper echo Y | rm overlayhelper)
@echo Remove Intermediate Files
@rm obj\*
# Goofy Object File Rule
obj/%.o : source/%.cpp
@echo Compiling $(<F)
$(CC) $(CFLAGS) $(INCCMD) -c $< -o obj/$*.o
# Create all the directories
$(shell if not exist $(DIRS) mkdir $(DIRS))