Last active
December 27, 2015 06:49
-
-
Save romsalva/7284830 to your computer and use it in GitHub Desktop.
Generic makefile
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 | |
SOURCES=main.cpp | |
OBJECTS=$(SOURCES:.cpp=.o) | |
#CC=gcc | |
CC=g++ | |
CFLAGS=-c -g | |
LDFLAGS= | |
all: build | |
build: $(TARGET) | |
clean: | |
rm -f *.o | |
rm -f $(TARGET) | |
rebuild: clean build | |
info: | |
@echo Sources: | |
@echo $(SOURCES) | |
@echo Objects | |
@echo $(OBJECTS) | |
$(TARGET): $(OBJECTS) | |
$(CC) $(LDFLAGS) $^ -o $@ | |
%.o: %.cpp | |
$(CC) $(CFLAGS) $< -o $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment