Last active
June 21, 2020 18:36
-
-
Save mkakh/0997ffc8f39b6f7684bad1a00948c857 to your computer and use it in GitHub Desktop.
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
| SRCDIR = src | |
| OBJDIR = obj | |
| BINDIR = bin | |
| PROGS = test hoge fuga | |
| .PHONY: all clean | |
| all: $(addprefix $(BINDIR)/,$(PROGS)) | |
| $(BINDIR)/test: $(OBJDIR)/test.o | |
| $(BINDIR)/hoge: $(OBJDIR)/hoge.o | |
| $(BINDIR)/fuga: $(OBJDIR)/fuga.o | |
| $(BINDIR)/%: $(OBJDIR)/%.o | |
| mkdir -p $(BINDIR) | |
| $(CC) $< -o $@ | |
| $(OBJDIR)/%.o: $(SRCDIR)/%.c | |
| mkdir -p $(OBJDIR) | |
| $(CC) -c $< -o $@ | |
| .PHONY: clean | |
| clean: | |
| rm -f obj/*.o bin/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment