mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-26 17:21:54 +02:00
78 lines
1.8 KiB
Makefile
78 lines
1.8 KiB
Makefile
#
|
|
# Makefile - Expanded component view generator
|
|
#
|
|
# 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.
|
|
#
|
|
|
|
PREFIX ?= /usr/local
|
|
|
|
OBJS = genex.o comp.o libs.o pdf.o
|
|
|
|
SHELL = /bin/bash
|
|
CFLAGS = -Wall -g
|
|
|
|
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
|
|
|
|
.PHONY: all clean spotless install uninstall
|
|
|
|
all: genex-bin
|
|
|
|
genex-bin: $(OBJS)
|
|
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)
|
|
|
|
%.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)
|
|
|
|
clean:
|
|
rm -f $(OBJS) $(OBJS:.o=.d)
|
|
|
|
spotless: clean
|
|
rm -f genex-bin
|
|
|
|
#
|
|
# Note: we use .../lib/genex/ instead of .../libexec/genex/ because FHS-3.0
|
|
# does not define libexec under the /usr/local/ hierarchy. (And older versions
|
|
# of FHS don't define libexec at all.)
|
|
#
|
|
|
|
install: all
|
|
mkdir -p $(DESTDIR)/$(PREFIX)/bin
|
|
mkdir -p $(DESTDIR)/$(PREFIX)/lib/genex
|
|
./mkgenex-wrapper -m 755 -p $(DESTDIR)/$(PREFIX)/lib/genex/ \
|
|
$(DESTDIR)/$(PREFIX)/bin/genex
|
|
install -m 755 genex-bin $(DESTDIR)/$(PREFIX)/lib/genex/
|
|
install -m 755 sym2xps $(DESTDIR)/$(PREFIX)/lib/genex/
|
|
install -m 755 expand-pintype $(DESTDIR)/$(PREFIX)/lib/genex/
|
|
|
|
uninstall:
|
|
rm -f $(DESTDIR)/$(PREFIX)/bin/genex
|
|
rm -rf $(DESTDIR)/$(PREFIX)/lib/genex
|
|
|