Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Compiler and flags
- CC = gcc
- CFLAGS = -Wall -g
- # Object files
- OBJS = k.o main.o
- # Executable name
- EXEC = main
- # Default target
- all: $(EXEC)
- # Linking object files to create the executable
- $(EXEC): $(OBJS)
- $(CC) $(CFLAGS) -o $(EXEC) $(OBJS)
- # Compiling source files to object files
- k.o: k.c k.h
- $(CC) $(CFLAGS) -c k.c
- main.o: main.c k.h
- $(CC) $(CFLAGS) -c main.c
- # Clean up
- clean:
- rm -f $(EXEC) $(OBJS)
- .PHONY: all clean
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement