Created
February 12, 2015 10:23
-
-
Save nodtem66/81c7d0da3010c156ce7e to your computer and use it in GitHub Desktop.
Simple 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
CC=gcc | |
LDFLAGS=-lusb-1.0 | |
CFLAGS=-c -Wall | |
SRC=test_iso.c | |
OBJ=$(SRC:.c=.o) | |
EXEC=iso | |
.PHONY: all clean | |
.SECONDARY: main-build | |
all: pre-build main-build | |
pre-build: | |
post-build: | |
rm -f $(OBJ) | |
main-build: target | |
target : $(OBJ) | |
$(CC) $(LDFLAGS) $(OBJ) -o $(EXEC) | |
@$(MAKE) --no-print-directory post-build | |
.cpp.o: | |
$(CC) $(CFLAGS) $< -o $@ | |
.c.o: | |
$(CC) $(CFLAGS) $< -o $@ | |
clean: | |
rm -f $(OBJ) $(EXEC) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment