47 lines
1.2 KiB
Makefile
47 lines
1.2 KiB
Makefile
# Setting these makes sure that the subsequent include files know that
|
|
# we are going to be threaded so they should do whatever they need to
|
|
# support this. In particular, this makes the global variable 'errno'
|
|
# become thread safe by replacing it with a call to the internal function
|
|
# ___errno() on Solaris - and should do something similar on other operating
|
|
# systems. Solaris also supports _TS_ERRNO to enable thread-safe errno
|
|
# _REENTRANT is also required for the tempnam() function to be properly
|
|
# thread-safe.
|
|
DEFS=-D_REENTRANT -D_TS_ERRNO
|
|
|
|
SRCS= main.c
|
|
|
|
OBJS= $(SRCS:.c=.o)
|
|
CC=gcc
|
|
CFLAGS=-O2 -g -DNDEBUG
|
|
#WARN=-pedantic -Wall -Wnested-externs -Wpointer-arith -Werror -Wno-unused
|
|
WARN=-pedantic -Wall -W -Wnested-externs -Wpointer-arith -Wno-long-long \
|
|
-Wno-variadic-macros
|
|
INCS=
|
|
LIBS=-lpthread
|
|
|
|
all: tags bootstrapd
|
|
|
|
bootstrapd: ${OBJS}
|
|
@echo "Linking..."
|
|
@-[ -f bootstrapd ] && mv bootstrapd bootstrapd~
|
|
${CC} \
|
|
${WARN} \
|
|
${DEFS} \
|
|
${CFLAGS} -o $@ \
|
|
${OBJS} \
|
|
${LIBS}
|
|
strip bootstrapd
|
|
@echo "Done..."
|
|
|
|
clean:
|
|
@-touch core
|
|
rm -f bootstrapd bootstrapd~ *.o core tags
|
|
|
|
tags:
|
|
@-ctags *.[ch]
|
|
|
|
.c.o:
|
|
@echo " $<"
|
|
@$(CC) $(CFLAGS) ${WARN} ${DEFS} ${INCS} -c $< -o $@
|
|
|