mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-19 17:38:49 +00:00
The top and second level Makefiles that build the whole project by recursing into all their subdirectories had implemented these by long lists of invocations and then repeated these for all the all, clean, install, uninstall targets. There were mistakes such as some subdirectories not being cleaned. Introduce SUBDIRS variables instead and have the targets loop over those and additionally implement the clean, install, uninstall targets with a single rule.
22 lines
708 B
Makefile
22 lines
708 B
Makefile
# all of these can be over-ridden on the "make" command line if they don't suit your environment.
|
|
|
|
CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow
|
|
BIN=/usr/local/bin
|
|
INSTALL=install
|
|
CC=gcc
|
|
|
|
SUBDIRS=asc cosy decsys dtos8cvt gt7cvt hpconvert indent littcvt m8376 mksimtape mt2tpc mtcvt23 \
|
|
mtcvtfix mtcvtodd noff sfmtcvt strrem strsub tar2mt tp512cvt tpc2mt
|
|
|
|
.PHONY: all clean install uninstall
|
|
|
|
all:
|
|
for subdir in $(SUBDIRS); do \
|
|
$(MAKE) -C $$subdir CFLAGS="$(CFLAGS)" BIN="$(BIN)" INSTALL="$(INSTALL)" CC="$(CC)"; \
|
|
done
|
|
|
|
clean install uninstall:
|
|
for subdir in $(SUBDIRS); do \
|
|
$(MAKE) -C $$subdir CFLAGS="$(CFLAGS)" BIN="$(BIN)" INSTALL="$(INSTALL)" CC="$(CC)" $@; \
|
|
done
|