Root/genkicat/Makefile

1#
2# Makefile - Generate catalog of expanded components or footprints
3#
4# Copyright 2012 by Werner Almesberger
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11
12PREFIX ?= /usr/local
13
14OBJS = genkicat.o tree.o libs.o run.o comp.o fped.o pdf.o
15
16SHELL = /bin/bash
17CFLAGS = -Wall -g
18
19CC_normal := $(CC)
20DEPEND_normal := $(CPP) $(CFLAGS) -MM -MG
21
22CC_quiet = @echo " CC " $@ && $(CC_normal)
23GEN_quiet = @echo " GENERATE " $@ &&
24DEPEND_quiet = @$(DEPEND_normal)
25
26ifeq ($(V),1)
27    CC = $(CC_normal)
28    GEN =
29    DEPEND = $(DEPEND_normal)
30else
31    CC = $(CC_quiet)
32    GEN = $(GEN_quiet)
33    DEPEND = $(DEPEND_quiet)
34endif
35
36.PHONY: all clean spotless install uninstall
37
38all: genkicat-bin
39
40genkicat-bin: $(OBJS)
41        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)
42
43%.o: %.c
44        $(CC) -c $(CFLAGS) $*.c -o $*.o
45        $(DEPEND) $*.c | \
46          sed -e \
47            '/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \
48            -e '$${g;p;}' -e d >$*.d; \
49          [ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $*.d; exit 1; }
50
51-include $(OBJS:.o=.d)
52
53clean:
54        rm -f $(OBJS) $(OBJS:.o=.d)
55
56spotless: clean
57        rm -f genkicat-bin
58
59#
60# Note: we use .../lib/genkicat/ instead of .../libexec/genkicat/ because
61# FHS-3.0 does not define libexec under the /usr/local/ hierarchy. (And
62# older versions of FHS don't define libexec at all.)
63#
64
65install: all
66        mkdir -p $(DESTDIR)/$(PREFIX)/bin
67        mkdir -p $(DESTDIR)/$(PREFIX)/lib/genkicat
68        ./mkgenkicat-wrapper -m 755 -p \
69          $(DESTDIR)/$(PREFIX)/lib/genkicat/ \
70          $(DESTDIR)/$(PREFIX)/bin/genkicat
71        install -m 755 genkicat-bin $(DESTDIR)/$(PREFIX)/lib/genkicat/
72        install -m 755 sym2xps $(DESTDIR)/$(PREFIX)/lib/genkicat/
73        install -m 755 expand-pintype $(DESTDIR)/$(PREFIX)/lib/genkicat/
74
75uninstall:
76        rm -f $(DESTDIR)/$(PREFIX)/bin/genkicat
77        rm -rf $(DESTDIR)/$(PREFIX)/lib/genkicat
78

Archive Download this file

Branches:
master



interactive