proj: Add exam-2020W-2A
This commit is contained in:
38
proj/exam-2020W-2A/src/Makefile.student
Normal file
38
proj/exam-2020W-2A/src/Makefile.student
Normal file
@@ -0,0 +1,38 @@
|
||||
##
|
||||
# Makefile for server.
|
||||
#
|
||||
|
||||
|
||||
# config
|
||||
|
||||
DEFS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_POSIX_C_SOURCE=200809 -D_XOPEN_SOURCE
|
||||
override CFLAGS += -Wall -g -std=c99 -pedantic $(DEFS)
|
||||
override LDFLAGS +=
|
||||
override LIBS += -pthread -lrt
|
||||
|
||||
# objects to build
|
||||
OBJS = server.o
|
||||
|
||||
# objects to link (already built)
|
||||
LDOBJS = server_lib.o
|
||||
|
||||
|
||||
# rules
|
||||
|
||||
.PHONY : all clean
|
||||
|
||||
all: server
|
||||
|
||||
server: $(OBJS) $(LDOBJS)
|
||||
gcc $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
%.o: %.c
|
||||
gcc $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f server $(OBJS)
|
||||
|
||||
|
||||
# dependencies
|
||||
|
||||
server.o: server.c
|
||||
Reference in New Issue
Block a user