Skip to content

Commit

Permalink
Object relocation example keep main.o
Browse files Browse the repository at this point in the history
  • Loading branch information
fzakaria committed Feb 19, 2024
1 parent 1ef70d5 commit 4c40044
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/object-relocations/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ 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


.PHONY: clean
clean:
rm -f $(TARGET) sum.o
rm -f $(TARGET) sum.o main.o

0 comments on commit 4c40044

Please sign in to comment.