Advertisement
greedydev

Untitled

Mar 22nd, 2023
1,604
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.42 KB | None | 0 0
  1. # Compiler and flags
  2. CC = gcc
  3. CFLAGS = -Wall -g
  4.  
  5. # Object files
  6. OBJS = k.o main.o
  7.  
  8. # Executable name
  9. EXEC = main
  10.  
  11. # Default target
  12. all: $(EXEC)
  13.  
  14. # Linking object files to create the executable
  15. $(EXEC): $(OBJS)
  16.     $(CC) $(CFLAGS) -o $(EXEC) $(OBJS)
  17.  
  18. # Compiling source files to object files
  19. k.o: k.c k.h
  20.     $(CC) $(CFLAGS) -c k.c
  21.  
  22. main.o: main.c k.h
  23.     $(CC) $(CFLAGS) -c main.c
  24.  
  25. # Clean up
  26. clean:
  27.     rm -f $(EXEC) $(OBJS)
  28.  
  29. .PHONY: all clean
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement