aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile25
1 files changed, 18 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index d2db120..7a4c5e1 100644
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,8 @@ MAN5S=xex.5
MAN7S=atascii.7
DOCS=README equates.inc *.dasm
+SUBDIRS=ksiders
+
# All the programs share this version number...
VERSION=0.2.1
@@ -45,7 +47,10 @@ RST2MAN=rst2man
# "make clean" and "make distclean" will not delete the 6502 object
# code (the *.bin files), but "make realclean" will.
-all: $(BINS) manpages symlinks
+all: $(BINS) manpages symlinks subdirs
+
+subdirs:
+ for dir in $(SUBDIRS); do make -C $$dir COPT=$(COPT); done
a8eol: a8eol.c
@@ -149,6 +154,7 @@ manpages: $(MANS) $(MAN5S) $(MAN7S)
# also, it doesn't remove the man pages. these are checked into git, even.
clean:
rm -f core *.o *~ $(BINS)
+ for dir in $(SUBDIRS); do make -C $$dir clean; done
distclean: clean
rm -rf *.syms *.atr 1 2 3 *.xex *.rom *.atasm *.m65 atrcheck cart2rom
@@ -156,12 +162,12 @@ distclean: clean
realclean: distclean
rm -f *.bin *_bin.[ch] *_offsets.h $(MANS) $(MAN5S) $(MAN7S)
-install: all
+install: all install-subdirs
mkdir -p $(DESTDIR)/$(BINDIR) $(DESTDIR)/$(MAN1DIR) $(DESTDIR)/$(MAN5DIR) $(DESTDIR)/$(MAN7DIR) $(DESTDIR)/$(DOCDIR)
strip $(BINS)
for i in $(BINS) $(SCRIPTS) ; do \
- install -m0755 -oroot -groot $$i $(DESTDIR)/$(BINDIR) ; \
- install -m0644 -oroot -groot $$i.1 $(DESTDIR)/$(MAN1DIR) ; \
+ install -m0755 $$i $(DESTDIR)/$(BINDIR) ; \
+ install -m0644 $$i.1 $(DESTDIR)/$(MAN1DIR) ; \
if [ "$(GZIP_MAN)" = "y" ]; then \
gzip -f $(DESTDIR)/$(MAN1DIR)/$$i.1 ; \
fi ; \
@@ -169,13 +175,13 @@ install: all
( cd $(DESTDIR)/$(BINDIR) && rm -f atrcheck && ln -s atr2xfd atrcheck )
( cd $(DESTDIR)/$(BINDIR) && rm -f cart2rom && ln -s rom2cart cart2rom )
for i in $(MAN5S) ; do \
- install -m0644 -oroot -groot $$i $(DESTDIR)/$(MAN5DIR) ; \
+ install -m0644 $$i $(DESTDIR)/$(MAN5DIR) ; \
if [ "$(GZIP_MAN)" = "y" ]; then \
gzip -f $(DESTDIR)/$(MAN5DIR)/$$i ; \
fi ; \
done
for i in $(MAN7S) ; do \
- install -m0644 -oroot -groot $$i $(DESTDIR)/$(MAN7DIR) ; \
+ install -m0644 $$i $(DESTDIR)/$(MAN7DIR) ; \
if [ "$(GZIP_MAN)" = "y" ]; then \
gzip -f $(DESTDIR)/$(MAN7DIR)/$$i ; \
fi ; \
@@ -186,4 +192,9 @@ install: all
else \
cd $(DESTDIR)/$(MAN1DIR) && rm -f cart2rom.1 && ln -s rom2cart.1 cart2rom.1 ; \
fi
- install -m0644 -oroot -groot $(DOCS) $(DESTDIR)/$(DOCDIR)
+ install -m0644 $(DOCS) $(DESTDIR)/$(DOCDIR)
+
+install-subdirs: subdirs
+ for dir in $(SUBDIRS); do \
+ make -C $$dir DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) BINDIR=$(BINDIR) MAN1DIR=$(MAN1DIR); \
+ done