From 71c073abf06d27cd827e3e20a4890e14d54c2192 Mon Sep 17 00:00:00 2001 From: schurma Date: Sat, 15 Aug 2020 21:57:26 -0500 Subject: [PATCH] Update Makefile MakeFile builds all the injector c source code files with the -ldl gcc switch for dlopen and dlsym. --- inject/src/Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/inject/src/Makefile b/inject/src/Makefile index e69de29..81364ad 100644 --- a/inject/src/Makefile +++ b/inject/src/Makefile @@ -0,0 +1,24 @@ +TARGET = injector +LIBS = -ldl +CC = gcc +CFLAGS = -g -Wall + +.PHONY: default all clean + +default: $(TARGET) +all: default + +OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c)) +HEADERS = $(wildcard *.h) + +%.o: %.c $(HEADERS) + $(CC) $(CFLAGS) -c $< -o $@ + +.PRECIOUS: $(TARGET) $(OBJECTS) + +$(TARGET): $(OBJECTS) + $(CC) $(OBJECTS) -Wall $(LIBS) -o $@ + +clean: + -rm -f *.o + -rm -f $(TARGET)