diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -1,7 +1,8 @@ CC = gcc -CFLAGS = -Wall -Wextra -O2 -g -std=c11 -fwrapv +CFLAGS = -Wall -Wextra -O2 -g -std=c11 -fwrapv -pthread +LDFLAGS = -pthread -TARGETS = server client +TARGETS = server client serverd clientd SOURCES = $(filter-out $(patsubst %,%.c,$(TARGETS)),$(wildcard *.c)) OBJECTS = $(patsubst %.c,%.o,$(SOURCES)) @@ -14,11 +15,8 @@ clean: rm -f $(TARGETS) *.o -server: server.o $(OBJECTS) - $(CC) $(CFLAGS) $^ -o $@ - -client: client.o $(OBJECTS) - $(CC) $(CFLAGS) $^ -o $@ +$(TARGETS): %: %.o $(OBJECTS) + $(CC) $^ -o $@ $(LDFLAGS) %.o: %.c $(wildcard *.h) $(CC) $(CFLAGS) -c -o $@ $< |