Created
November 27, 2014 11:37
-
-
Save icedraco/6e81e096f60d4b06e3e0 to your computer and use it in GitHub Desktop.
Makefile nesting example
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
| EXEC=test | |
| all: | |
| cd src; make | |
| mv src/$(EXEC) ./ | |
| clean: | |
| rm -f src/*.o $(EXEC) | |
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
| CC=g++ | |
| EXEC=test | |
| FLAGS=-g | |
| SRC=DataType.cpp Exception.cpp Interpreter.cpp IO.cpp MyFloat.cpp MyInteger.cpp MyList.cpp MyString.cpp | |
| OBJ=$(addsuffix .o, $(basename $(SRC))) | |
| all: $(OBJ) | |
| $(CC) $(FLAGS) -o $(EXEC) $(OBJ) | |
| .cpp.o: | |
| $(CC) $(FLAGS) -c $< |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment