hazelnut/agent-vs2022/Makefile
modeco80 182266ec3c agent built with clang + vs2022 libs
a better compiler. also i dont need a seperate dev machine with vs 2013 installed anymore, thank god
2024-11-30 00:40:18 -05:00

83 lines
2 KiB
Makefile

include build/arch.mk
include build/configs.mk
NAME = hazelnut_agent
BINDIR = bin/$(ARCH)/$(CONFIG)
OBJDIR = obj/$(ARCH)/$(CONFIG)
VPATH = src/crt \
src/base \
src/ \
# Objects for crt
OBJS_STARTUP := $(OBJDIR)/crt0.o \
$(OBJDIR)/ctors.o \
$(OBJDIR)/exit.o
# Objects for base/ library
OBJS_BASELIB :=
OBJS := $(OBJDIR)/capture.o \
$(OBJDIR)/capture_nvfbc.o \
$(OBJDIR)/nvfbc_library.o \
$(OBJDIR)/main.o \
LINK_LIBS := ~/vs2022/ucrt/lib/$(ARCH)/libucrt$(D).lib \
~/vs2022/crt/lib/$(ARCH)/libcmt$(D).lib \
~/vs2022/crt/lib/$(ARCH)/libcpmt$(D).lib \
~/vs2022/crt/lib/$(ARCH)/libvcruntime$(D).lib \
~/vs2022/winsdk/lib/$(ARCH)/kernel32.lib \
~/vs2022/winsdk/lib/$(ARCH)/user32.lib \
~/vs2022/winsdk/lib/$(ARCH)/comctl32.lib \
~/vs2022/winsdk/lib/$(ARCH)/ws2_32.lib
.PHONY: all dumpinfo clean matrix
all: dumpinfo $(BINDIR)/$(NAME).exe
publish: $(BINDIR)/$(NAME).exe
cp -rv bin /data/sda/shit/Release/clangent
chmod -Rvv 777 /data/sda/shit/Release/clangent
dumpinfo:
echo -e "\e[96mBuilding configuration $(CONFIG) for arch $(ARCH) \e[0m"
matrix:
# $(MAKE) ARCH=x86 CONFIG=Debug
# $(MAKE) ARCH=x86 CONFIG=Release
$(MAKE) ARCH=x64 CONFIG=Debug
$(MAKE) ARCH=x64 CONFIG=Release
# dir rules
$(BINDIR)/:
echo -e "\e[95mMKDIR $@\e[0m"
mkdir -p $(BINDIR)
$(OBJDIR)/:
echo -e "\e[95mMKDIR $@\e[0m"
mkdir -p $(OBJDIR)
$(BINDIR)/$(NAME).exe: $(BINDIR)/ $(OBJDIR)/ $(OBJS)
echo -e "\e[92mLinking binary $@\e[0m"
$(LD) /nodefaultlib /subsystem:console,6.1 /out:$@ $(LINK_LIBS) $(OBJS)
# todo: stuff rules in build/
$(OBJDIR)/%.o: %.c
echo -e "\e[94mCompiling C source file $< ($@)\e[0m"
$(CC) -c $(BASE_CCFLAGS) -Isdk/inc $($(CONFIG)_CCFLAGS) $< -o $@
$(OBJDIR)/%.o: %.cpp
echo -e "\e[94mCompiling C++ source file $< ($@)\e[0m"
$(CC) -c $(BASE_CXXFLAGS) -Isdk/inc $($(CONFIG)_CXXFLAGS) $< -o $@
$(OBJDIR)/%.o: res/%.rc
echo -e "\e[94mCompiling Windows resource script $<\e[0m"
$(RC) $(RC_INCLUDES) /FO $@ $<
clean: dumpinfo
echo -e "\e[91mCleaning... \e[0m"
rm -rf $(BINDIR)/ $(OBJDIR)/
$V.SILENT: