66 lines
1.5 KiB
Makefile
66 lines
1.5 KiB
Makefile
|
|
||
|
MAKE=gmake
|
||
|
|
||
|
# 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 -DHMT_PROTECT
|
||
|
# -DWITH_MPATROL
|
||
|
|
||
|
SRCS= epg.c \
|
||
|
file.c \
|
||
|
main.c \
|
||
|
util.c
|
||
|
|
||
|
OBJS= $(SRCS:.c=.o)
|
||
|
CC=gcc
|
||
|
#CC=mipsel-linux-gcc
|
||
|
PLATFORM=$(shell uname -s | cut -d- -f1)
|
||
|
PROCESSOR=$(shell uname -p)
|
||
|
CFLAGS=-g
|
||
|
INCS=
|
||
|
LIBS=
|
||
|
ifeq ($(PLATFORM),CYGWIN_NT)
|
||
|
CFLAGS=-g -mno-cygwin
|
||
|
endif
|
||
|
#ifeq ($(PLATFORM),Linux)
|
||
|
#CFLAGS=-static -g
|
||
|
#endif
|
||
|
#CFLAGS=-g -O3 -fno-strict-aliasing
|
||
|
#WARN=-pedantic -Wall -Wnested-externs -Wpointer-arith -Werror -Wno-unused
|
||
|
WARN=-pedantic -Wall -W -Wnested-externs -Wpointer-arith -Wno-long-long
|
||
|
|
||
|
all: tags epg
|
||
|
|
||
|
epg: ${OBJS}
|
||
|
@echo "Linking..."
|
||
|
@-[ -f $@ ] && mv $@ $@~ || exit 0
|
||
|
${CC} -static-libgcc \
|
||
|
${WARN} \
|
||
|
${DEFS} \
|
||
|
${CFLAGS} -o $@ \
|
||
|
${OBJS} \
|
||
|
${LIBS}
|
||
|
@echo "Done..."
|
||
|
|
||
|
clean:
|
||
|
@-touch core
|
||
|
rm -f epg epg~ *.exe core tags asm ${OBJS} ${AROBJS}
|
||
|
rm -f *.raw *.raw.sum *.lh5
|
||
|
rm -rf epg-*
|
||
|
|
||
|
tags:
|
||
|
@-ctags *.[ch] 2>> /dev/null
|
||
|
|
||
|
.c.o:
|
||
|
@echo " $<"
|
||
|
@$(CC) $(CFLAGS) ${WARN} ${DEFS} ${INCS} -c $< -o $@
|
||
|
|
||
|
${OBJS}: lint.h
|
||
|
|