summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-03-09 10:12:58 -0700
committerOri Bernstein <ori@eigenstate.org>2015-03-09 10:12:58 -0700
commite9e8c537c2e10e3378c02d80d439c74514faec45 (patch)
tree17775a506d81d4791212c8a12f08f240581497c6 /libstd
parent571feb1d0c9e810665bf28737390d7437628053f (diff)
downloadmc-e9e8c537c2e10e3378c02d80d439c74514faec45.tar.gz
More makefile cleanups.
Separate stuff into GENSRC, and copy things correctly.
Diffstat (limited to 'libstd')
-rw-r--r--libstd/Makefile40
1 files changed, 30 insertions, 10 deletions
diff --git a/libstd/Makefile b/libstd/Makefile
index 123cbaf..1212f83 100644
--- a/libstd/Makefile
+++ b/libstd/Makefile
@@ -1,21 +1,31 @@
-SYSLIB=sys
-SYSSRC= \
+.SUFFIXES:
+GENSRC= \
dial.myr \
dir.myr \
env.myr \
ifreq.myr \
resolve.myr \
- syserrno.myr \
sys.myr \
+ syscall.s \
+ syserrno.myr \
syswrap.myr \
syswrap-ss.myr \
+ util.s \
wait.myr \
+SYSLIB=sys
+SYSSRC= \
+ sys.myr \
+ syscall.s \
+ syserrno.myr \
+ systypes.myr \
+ ifreq.myr \
+ util.s \
+
SYSASMSRC= \
syscall.s \
util.s
-
STDLIB=std
STDSRC= \
alloc.myr \
@@ -26,9 +36,12 @@ STDSRC= \
chartype.myr \
cmp.myr \
clear.myr \
+ dial.myr \
die.myr \
+ dir.myr \
dirname.myr \
endian.myr \
+ env.myr \
errno.myr \
execvp.myr \
extremum.myr \
@@ -50,6 +63,7 @@ STDSRC= \
pathjoin.myr \
putint.myr \
rand.myr \
+ resolve.myr \
result.myr \
search.myr \
slcp.myr \
@@ -67,17 +81,21 @@ STDSRC= \
strjoin.myr \
strsplit.myr \
strstrip.myr \
+ syswrap.myr \
+ syswrap-ss.myr \
swap.myr \
try.myr \
types.myr \
units.myr \
utf.myr \
varargs.myr \
+ wait.myr \
include ../config.mk
all: lib$(STDLIB).a $(MYRBIN)
+
# HACK HACK HACK.
# Ideally we would have patterns for the
# foo+arch-suffix.myr instead of a loop,
@@ -85,26 +103,28 @@ all: lib$(STDLIB).a $(MYRBIN)
# of patterns that Make will try, leading to
# millions of files getting statted. This
# works around that.
-COPYTARG = for suff in $(SYSCLASS)-$(SYS)-$(ARCH) \
+COPYTARG = for targ in \
+ $(SYSCLASS)-$(SYS)-$(ARCH) \
$(SYSCLASS)-$(SYS) \
$(SYSCLASS)-$(ARCH) \
$(SYSCLASS) \
$(SYS)-$(ARCH) \
$(SYS) \
$(ARCH); do \
- if [ -f $*+$$targ.$$ext ] ; then \
+ echo "trying $*+$$targ.$$ext"; \
+ if [ -f $*+$$targ.$$ext ] ; then \
echo $$targ; \
echo cp $*+$$targ.$$ext $@; \
cp $*+$$targ.$$ext $@; \
exit 0; \
- fi; \
+ fi; \
done; \
-%.myr: %+*.myr
+%.myr:
@export ext=myr; \
$(COPYTARG)
-%.s: %+*.s
+%.s:
@export ext=s; \
$(COPYTARG)
@@ -124,7 +144,7 @@ USE=$(STDSRC:.myr=.use) $(SYSSRC:.myr=.use) $(STDLIB)
clean:
rm -f $(OBJ)
rm -f $(USE)
- rm -f $(SYSSRC)
+ rm -f $(GENSRC)
rm -f lib$(STDLIB).a lib$(SYSLIB).a
install: all