Created
March 21, 2018 08:37
-
-
Save gyulkkajo/b15dfb8894a7b73a3da0a059ee4c8d77 to your computer and use it in GitHub Desktop.
Template of Makefile. It may be used for a simple c, c++ project.
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
.SUFFIXES : .c .o | |
CC = gcc | |
CFLAGS = -g $(INC) | |
INC = # -i -I | |
LIBS = # -l -L | |
DEPS = # *.h | |
OBJS = # *.o | |
TARGET = | |
all: $(TARGET) | |
%.o: %.c $(DEPS) | |
$(CC) -c -o $@ $< $(CFLAGS) | |
$(TARGET): $(OBJS) | |
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) | |
.PHONY: clean | |
clean: | |
rm -rf $(OBJS) $(TARGET) core |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment