Created
April 4, 2019 06:51
-
-
Save Tiim/f1766d71fd785bdd988b31d7167bab39 to your computer and use it in GitHub Desktop.
Makefile that compiles every source file to a executable in the bin dir. Conserves data structure.
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 | |
OBJDIR = bin | |
exec = udp/server udp/client tcp/server tcp/client | |
.PHONY: all clean | |
all: $(OBJDIR) $(exec) | |
clean: | |
rm -r $(OBJDIR) | |
$(OBJDIR): | |
mkdir -p $(OBJDIR) | |
$(exec): %: %.c | |
mkdir -p $(dir ${OBJDIR}/$@) | |
$(CC) -o $(OBJDIR)/$@ $< |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment