diff --git a/examples/object-relocations/Makefile b/examples/object-relocations/Makefile index f86dbf3..ac108b0 100644 --- a/examples/object-relocations/Makefile +++ b/examples/object-relocations/Makefile @@ -6,8 +6,11 @@ TARGET = exe # Default rule all: $(TARGET) -$(TARGET): main.c sum.o - $(CC) $(CFLAGS) -o $(TARGET) main.c sum.o +$(TARGET): main.o sum.o + $(CC) $(CFLAGS) -o $(TARGET) main.o sum.o + +main.o: main.c sum.h + $(CC) $(CFLAGS) -c main.c sum.o: sum.c sum.h $(CC) $(CFLAGS) -c sum.c @@ -15,4 +18,4 @@ sum.o: sum.c sum.h .PHONY: clean clean: - rm -f $(TARGET) sum.o \ No newline at end of file + rm -f $(TARGET) sum.o main.o \ No newline at end of file