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_PATH)/ucrt/lib/$(ARCH)/libucrt$(D).lib \ $(VS2022_PATH)/crt/lib/$(ARCH)/libcmt$(D).lib \ $(VS2022_PATH)/crt/lib/$(ARCH)/libcpmt$(D).lib \ $(VS2022_PATH)/crt/lib/$(ARCH)/libvcruntime$(D).lib \ $(VS2022_PATH)/winsdk/lib/$(ARCH)/kernel32.lib \ $(VS2022_PATH)/winsdk/lib/$(ARCH)/user32.lib \ $(VS2022_PATH)/winsdk/lib/$(ARCH)/comctl32.lib \ $(VS2022_PATH)/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: