-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
40 lines (31 loc) · 829 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
CC = cc
STRIP = strip
CROSS := $(TARGET)
CFLAGS := -O2 -ggdb -pipe \
-W -Wall -Wextra \
-Wshadow -Wformat-security -Wstrict-prototypes \
-Wredundant-decls -Wold-style-definition
RM = /bin/rm -f
Q = @
LIBS = -lpthread
FUNCS_DIR = libfuncs
FUNCS_LIB = $(FUNCS_DIR)/libfuncs.a
tomcast_OBJS = tomcast.o web_pages.o web_server.o $(FUNCS_LIB)
all: tomcast
$(FUNCS_LIB):
$(Q)echo " MAKE $(FUNCS_LIB)"
$(Q)$(MAKE) -s -C $(FUNCS_DIR)
tomcast: $(tomcast_OBJS)
$(Q)echo " LINK tomcast"
$(Q)$(CROSS)$(CC) $(CFLAGS) $(tomcast_OBJS) $(LIBS) -o tomcast
%.o: %.c
$(Q)echo " CC tomcast $<"
$(Q)$(CROSS)$(CC) $(CFLAGS) -c $<
strip:
$(Q)echo " STRIP tomcast"
$(Q)$(CROSS)$(STRIP) tomcast
clean:
$(Q)echo " RM $(tomcast_OBJS)"
$(Q)$(RM) $(tomcast_OBJS) tomcast *~
distclean: clean
$(Q)$(MAKE) -s -C $(FUNCS_DIR) clean