-
-
Save jrelo/ca83738a0c73a3827ce483faa6393851 to your computer and use it in GitHub Desktop.
simple makefile for C
This file contains hidden or 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 = test | |
| CC = gcc | |
| CFLAGS = -c -v | |
| VPATH = src | |
| SRC = test.c | |
| OBJ = $(SRC:.c=.o) | |
| all:$(TARGET) | |
| $(TARGET):$(OBJ) | |
| $(CC) -o $@ $(OBJ) | |
| .SUFFIXES: .c .o | |
| .c.o: | |
| $(CC) $(CFLAGS) $< | |
| clean: | |
| rm -f $(TARGET) $(TARGET).exe | |
| rm -f *.o *.obj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment