Serwer/Makefile

36 lines
892 B
Makefile
Raw Permalink Normal View History

2017-01-01 23:03:06 +00:00
#
# Makefile for Serwer
#
# Author: overflowerror
#
#
CC = gcc
DEFS = -D_XOPEN_SOURCE=500 -D_BSD_SOURCE
2017-01-02 22:01:06 +00:00
CFLAGS = -Wall -Wextra -g -std=c99 -pedantic -DENDEBUG $(DEFS) -fPIC
2017-01-01 23:03:06 +00:00
LDFLAGS = $(DEFS)
2017-01-02 22:01:06 +00:00
LIBFLAGS = -shared $(DEFS)
2017-01-01 23:03:06 +00:00
.PHONY: all clean
2017-01-02 22:01:06 +00:00
all: example libserwer.so
2017-01-01 23:03:06 +00:00
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
example: example.o serwer.o ws_modes/linear.o ws_handlers/info.o ws_utils.o help.o
2017-01-01 23:03:06 +00:00
$(CC) $(LDFLAGS) -o $@ $^
libserwer.so: serwer.o ws_modes/linear.o ws_handlers/info.o ws_utils.o help.o
2017-01-02 22:01:06 +00:00
$(CC) $(LIBFLAGS) -o $@ $^
2017-01-02 21:48:49 +00:00
example.o: example.c serwer.h help.h
2017-01-01 23:03:06 +00:00
help.o: help.c help.h
2017-01-02 21:48:49 +00:00
serwer.o: serwer.c serwer.h ws_types.h ws_modes.h ws_utils.h help.h
2017-01-02 21:31:05 +00:00
ws_utils.o: ws_utils.c ws_utils.h ws_types.h
ws_modes/linear.o: ws_modes/linear.c ws_modes.h ws_types.h serwer.h ws_utils.h
ws_handlers/info.o: ws_handlers/info.c ws_handlers.h serwer.h
2017-01-01 23:03:06 +00:00
clean:
rm -f *.o ws_modes/*.o example libserwer.so