2012-03-31 00:53:51 +03:00
|
|
|
#
|
2012-07-13 02:14:45 +03:00
|
|
|
# Makefile - Generate catalog of expanded components or footprints
|
2012-03-31 00:53:51 +03:00
|
|
|
#
|
|
|
|
# Copyright 2012 by Werner Almesberger
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
|
2012-04-18 00:17:01 +03:00
|
|
|
PREFIX ?= /usr/local
|
|
|
|
|
2012-07-13 02:12:08 +03:00
|
|
|
OBJS = genkicat.o tree.o libs.o run.o comp.o fped.o pdf.o
|
2012-03-31 00:53:51 +03:00
|
|
|
|
2012-04-17 23:14:24 +03:00
|
|
|
SHELL = /bin/bash
|
|
|
|
CFLAGS = -Wall -g
|
|
|
|
|
2012-03-31 00:53:51 +03:00
|
|
|
CC_normal := $(CC)
|
|
|
|
DEPEND_normal := $(CPP) $(CFLAGS) -MM -MG
|
|
|
|
|
|
|
|
CC_quiet = @echo " CC " $@ && $(CC_normal)
|
|
|
|
GEN_quiet = @echo " GENERATE " $@ &&
|
|
|
|
DEPEND_quiet = @$(DEPEND_normal)
|
|
|
|
|
|
|
|
ifeq ($(V),1)
|
|
|
|
CC = $(CC_normal)
|
|
|
|
GEN =
|
|
|
|
DEPEND = $(DEPEND_normal)
|
|
|
|
else
|
|
|
|
CC = $(CC_quiet)
|
|
|
|
GEN = $(GEN_quiet)
|
|
|
|
DEPEND = $(DEPEND_quiet)
|
|
|
|
endif
|
|
|
|
|
2012-04-18 00:17:01 +03:00
|
|
|
.PHONY: all clean spotless install uninstall
|
2012-03-31 00:53:51 +03:00
|
|
|
|
2012-07-13 02:12:08 +03:00
|
|
|
all: genkicat-bin
|
2012-03-31 00:53:51 +03:00
|
|
|
|
2012-07-13 02:12:08 +03:00
|
|
|
genkicat-bin: $(OBJS)
|
2012-03-31 00:53:51 +03:00
|
|
|
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)
|
|
|
|
|
2012-04-17 23:14:24 +03:00
|
|
|
%.o: %.c
|
|
|
|
$(CC) -c $(CFLAGS) $*.c -o $*.o
|
|
|
|
$(DEPEND) $*.c | \
|
|
|
|
sed -e \
|
|
|
|
'/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \
|
|
|
|
-e '$${g;p;}' -e d >$*.d; \
|
|
|
|
[ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $*.d; exit 1; }
|
|
|
|
|
|
|
|
-include $(OBJS:.o=.d)
|
|
|
|
|
2012-03-31 00:53:51 +03:00
|
|
|
clean:
|
2012-04-17 23:14:24 +03:00
|
|
|
rm -f $(OBJS) $(OBJS:.o=.d)
|
2012-04-17 23:10:03 +03:00
|
|
|
|
|
|
|
spotless: clean
|
2012-07-13 02:12:08 +03:00
|
|
|
rm -f genkicat-bin
|
2012-04-18 00:17:01 +03:00
|
|
|
|
|
|
|
#
|
2012-07-13 02:12:08 +03:00
|
|
|
# Note: we use .../lib/genkicat/ instead of .../libexec/genkicat/ because
|
|
|
|
# FHS-3.0 does not define libexec under the /usr/local/ hierarchy. (And
|
|
|
|
# older versions of FHS don't define libexec at all.)
|
2012-04-18 00:17:01 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
install: all
|
|
|
|
mkdir -p $(DESTDIR)/$(PREFIX)/bin
|
2012-07-13 02:12:08 +03:00
|
|
|
mkdir -p $(DESTDIR)/$(PREFIX)/lib/genkicat
|
|
|
|
./mkgenkicat-wrapper -m 755 -p \
|
|
|
|
$(DESTDIR)/$(PREFIX)/lib/genkicat/ \
|
|
|
|
$(DESTDIR)/$(PREFIX)/bin/genkicat
|
|
|
|
install -m 755 genkicat-bin $(DESTDIR)/$(PREFIX)/lib/genkicat/
|
|
|
|
install -m 755 sym2xps $(DESTDIR)/$(PREFIX)/lib/genkicat/
|
|
|
|
install -m 755 expand-pintype $(DESTDIR)/$(PREFIX)/lib/genkicat/
|
2012-04-18 00:17:01 +03:00
|
|
|
|
|
|
|
uninstall:
|
2012-07-13 02:12:08 +03:00
|
|
|
rm -f $(DESTDIR)/$(PREFIX)/bin/genkicat
|
|
|
|
rm -rf $(DESTDIR)/$(PREFIX)/lib/genkicat
|