# Step 02 -- Build the COFF inspector tool + a test BOF to inspect
#
# Usage:
#   make                -- build both the inspector and the test BOF
#   make inspect        -- run the inspector on hello_bof.o
#   make clean          -- remove compiled files

CC_MINGW = x86_64-w64-mingw32-gcc
CC_HOST  = gcc
CFLAGS   = -c

all: coff_inspector hello_bof.o

coff_inspector: coff_inspector.c COFFLoader.h
	$(CC_HOST) coff_inspector.c -o coff_inspector

hello_bof.o: hello_bof.c beacon.h
	$(CC_MINGW) $(CFLAGS) hello_bof.c -o hello_bof.o

inspect: coff_inspector hello_bof.o
	./coff_inspector hello_bof.o

clean:
	rm -f coff_inspector coff_inspector.exe *.o *.obj
