2011-06-01 23:34:35 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2011-06-02 11:14:43 +00:00
|
|
|
SRCS= descriptor.c \
|
|
|
|
epg.c \
|
2011-06-01 23:34:35 +00:00
|
|
|
file.c \
|
|
|
|
main.c \
|
|
|
|
util.c
|
|
|
|
|
2011-06-02 11:14:43 +00:00
|
|
|
HDRS= descriptor.h \
|
|
|
|
epg.h \
|
|
|
|
lint.h \
|
|
|
|
util.h
|
|
|
|
|
2011-06-01 23:34:35 +00:00
|
|
|
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 $@
|
|
|
|
|
2011-06-02 11:14:43 +00:00
|
|
|
${OBJS}: ${HDRS}
|
2011-06-01 23:34:35 +00:00
|
|
|
|