Last active
November 7, 2018 05:18
-
-
Save shiva-karthick/db8c4d11e443cf6d6385f6144f9ee380 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TARGET = a | |
LIBS = -lm | |
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment