epg/Makefile

64 lines
934 B
Makefile

MAKE=gmake
DEFS=
SRCS= descriptor.c \
epg.c \
file.c \
huffman.c \
main.c \
util.c
HDRS= descriptor.h \
epg.h \
lint.h \
util.h
OBJS= $(SRCS:.c=.o)
CC=gcc
#CC=mipsel-linux-gcc
CFLAGS=-g
INCS=
LIBS=
#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
PLATFORM=$(shell uname -s | cut -d- -f1)
ifeq ($(PLATFORM),Linux)
DEFS=-DHAVE_SQLITE3
LIBS=-lsqlite3 -lxconv
endif
all: tags epg
install: epg
strip epg
cp epg /mod/bin/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~ core tags ${OBJS}
tags:
@-ctags *.[ch] 2>> /dev/null
.c.o:
@echo " $<"
@$(CC) $(CFLAGS) ${WARN} ${DEFS} ${INCS} -c $< -o $@
${OBJS}: ${HDRS}