This repository has been archived on 2021-08-17. You can view files and clone it, but cannot push or open issues or pull requests.
unix/http/Makefile

27 lines
686 B
Makefile
Raw Normal View History

CC = gcc
CFLAGS = -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_POSIX_C_SOURCE=200809L -g -c
TARGET_1 = client
TARGET_2 = server
all: $(TARGET_1).c $(TARGET_2).c
$(CC) $(CFLAGS) $(TARGET_1).c $(TARGET_2).c
$(CC) $(TARGET_1).o -o $(TARGET_1)
$(CC) $(TARGET_2).o -o $(TARGET_2)
client: $(TARGET_1).c
$(CC) $(CFLAGS) $(TARGET_1).c
$(CC) $(TARGET_1).o -o $(TARGET_1)
server: $(TARGET_2).c
$(CC) $(CFLAGS) $(TARGET_2).c
$(CC) $(TARGET_2).o -o $(TARGET_2)
install:
cp $(TARGET_1) /usr/local/bin/myhttp-$(TARGET_1)
cp $(TARGET_2) /usr/local/bin/myhttp-$(TARGET_2)
clean:
$(RM) $(TARGET_1).o
$(RM) $(TARGET_1)
$(RM) $(TARGET_2).o
$(RM) $(TARGET_2)