Improvements in the Makefile for a build safe in parallel and installation of desktop files

This commit is contained in:
Mike Molina 2023-02-24 19:22:26 -05:00
parent c7d476536a
commit d483ba88e5
1 changed files with 36 additions and 10 deletions

View File

@ -1,4 +1,4 @@
# Sample Makefile for xephem v3.7 # Sample Makefile for xephem v4.1.0
# Sample compile and link flags for a few systems. Find your system or similar # Sample compile and link flags for a few systems. Find your system or similar
# and uncomment as required. The default is for linux or Mac OS X systems. # and uncomment as required. The default is for linux or Mac OS X systems.
@ -43,6 +43,13 @@ LDFLAGS = $(LIBLNK) $(CLDFLAGS) -L$(MOTIFL) $(PLATL)
XLIBS = -lXm -lXt -lXext -lXmu -lX11 XLIBS = -lXm -lXt -lXext -lXmu -lX11
LIBS = $(XLIBS) $(LIBLIB) -lm -lssl LIBS = $(XLIBS) $(LIBLIB) -lm -lssl
# Variables installation for Linux
prefix := /usr/local
bindir = $(prefix)/bin
datadir = $(prefix)/share
mandir = $(datadir)/man
export datadir
# static linking on Apple using X11 libs from ports # static linking on Apple using X11 libs from ports
# CC = gcc # CC = gcc
# OLI = /opt/local/include # OLI = /opt/local/include
@ -192,24 +199,43 @@ OBJS = \
xephem.o \ xephem.o \
xmisc.o xmisc.o
all: libs xephem xephem.1 all: xephem xephem.1
xephem: $(INCS) $(OBJS) xephem: libs $(INCS) $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
xephem.1: xephem.man xephem.1: xephem.man
nroff -man $? > $@ cp $? $@
libs: libs:
cd ../../libastro; make $(MAKE) -C ../../libastro
cd ../../libip; make $(MAKE) -C ../../libip
cd ../../libjpegd; make $(MAKE) -C ../../libjpegd
cd ../../liblilxml; make $(MAKE) -C ../../liblilxml
cd ../../libpng; make $(MAKE) -C ../../libpng
cd ../../libz; make $(MAKE) -C ../../libz
clean: clean:
rm -fr *.o ../../lib*/*.[ao] rm -fr *.o ../../lib*/*.[ao]
clobber: clean clobber: clean
rm -fr xephem xephem.1 rm -fr xephem xephem.1
# Installation
install: install-binary install-man install-data install-desktopfiles
install-binary:
install -Dm 755 xephem -t $(DESTDIR)$(bindir)
install-man:
install -Dm 644 xephem.1 -t $(DESTDIR)$(mandir)/man1
install-data:
install -dm 755 $(DESTDIR)$(datadir)/xephem
@for d in auxil catalogs fifos fits gallery help lo; do \
echo "cp -R $$d $(DESTDIR)$(datadir)/xephem"; \
cp -R $$d $(DESTDIR)$(datadir)/xephem; \
done
install-desktopfiles:
$(MAKE) -C ../../desktopfiles DESTDIR=$(DESTDIR) install