verzia 1.2, 2002/08/11 19:36:35 |
verzia 1.3, 2002/08/11 20:42:54 |
|
|
CC=gcc |
# Makefile for creating distribution of test package |
CFLAGS=-Wall -pedantic -ansi -ggdb -lvgagl -lvga |
# Type 'make dist' for create tar-gziped archiv. |
all: |
|
$(CC) $(CFLAGS) -o cpdf cpdf.c |
# |
|
# Author: Lubomir Host 'rajo' <host8@kepler.fmph.uniba.sk |
|
# |
|
|
|
# $Id$ |
|
|
|
PACKAGE = cpdf |
|
VERSION = 0.1 |
|
|
|
# Directories {{{ |
|
|
|
srcdir = . |
|
top_srcdir = . |
|
distdir = $(PACKAGE)-$(VERSION) |
|
top_distdir = $(distdir) |
|
top_builddir = . |
|
|
|
# }}} Directories |
|
|
|
# Targets {{{ |
|
PROGRAM = cpdf |
|
|
|
SOURCES = $(srcdir)/cpdf.c |
|
|
|
OBJECTS = $(top_builddir)/cpdf.o |
|
|
|
DEP_FILES = $(top_builddir)/.deps/cpdf.P |
|
|
|
DISTFILES = Makefile \ |
|
cpdf.c \ |
|
pdf.h |
|
|
|
|
|
CONFIG_HEADER = |
|
|
|
# }}} Targets |
|
|
|
# Programs {{{ |
|
|
|
TAR = tar |
|
ZIP = zip |
|
ZIP_ENV = -r9 |
|
GZIP_ENV = --best |
|
|
|
CC = gcc |
|
CPP = |
|
CXX = |
|
#DEBUG_FLAGS = -g -ggdb -DDEBUG |
|
CFLAGS = -O2 -Wall -Wshadow -pedantic -ansi $(DEBUG_FLAGS) |
|
CPPFLAGS = |
|
LDFLAGS = |
|
DEFS = |
|
INCLUDES = -I$(srcdir) -I$(top_builddir) |
|
LIBS = -lvgagl -lvga |
|
|
|
|
|
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) |
|
CCLD = $(CC) |
|
LINK = $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@ |
|
|
|
# }}} Programs |
|
|
|
all: $(PROGRAM) |
|
|
|
$(PROGRAM): $(OBJECTS) |
|
$(LINK) $(OBJECTS) $(LIBS) |
|
|
|
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) |
|
#-include $(DEP_FILES) |
|
|
|
.s.o: |
|
$(COMPILE) -c $< |
|
|
|
%.o: %.c $(CONFIG_HEADER) |
|
@echo '$(COMPILE) -c $<'; \ |
|
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -o $@ -c $< |
|
@-cp .deps/$(*F).pp .deps/$(*F).P; \ |
|
tr ' ' '\012' < .deps/$(*F).pp \ |
|
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ |
|
>> .deps/$(*F).P; \ |
|
rm .deps/$(*F).pp |
|
|
|
clean: |
|
-rm -f *.o core |
|
|
|
.PHONY: sources |
|
sources: |
|
@echo $(SOURCES:%=cfg/%) |
|
|
|
# Distribution targets {{{ |
|
dist: distdir |
|
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) |
|
ZIP=$(ZIP_ENV) $(ZIP) $(distdir).zip $(distdir) |
|
-rm -rf $(distdir) |
|
|
|
dist-all: distdir |
|
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) |
|
ZIP=$(ZIP_ENV) $(ZIP) $(distdir).zip $(distdir) |
|
-rm -rf $(distdir) |
|
|
|
distdir: $(DISTFILES) |
|
-rm -rf $(distdir) |
|
mkdir $(distdir) |
|
@here=`cd $(top_builddir) && pwd`; \ |
|
top_distdir=`cd $(distdir) && pwd`; \ |
|
distdir=`cd $(distdir) && pwd`; |
|
@FILES=`echo "$(DISTFILES)" | awk 'BEGIN{RS=" "}{print}' | sort -u`; \ |
|
for file in $$FILES; do \ |
|
d=$(srcdir); \ |
|
if test -d $$d/$$file; then \ |
|
mkdir $(distdir)/$$file; \ |
|
else \ |
|
test -f $(distdir)/$$file \ |
|
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \ |
|
|| cp -p $$d/$$file $(distdir)/$$file || :; \ |
|
fi; \ |
|
done |
|
|
|
# }}} |
|
|
|
# vim600: fdm=marker fdc=3 |
|
|
|
|