diff --git a/bin/eigenvector2/Makefile b/bin/eigenvector2/Makefile index 6500128a6..74a415a22 100644 --- a/bin/eigenvector2/Makefile +++ b/bin/eigenvector2/Makefile @@ -1,19 +1,10 @@ +.POSIX: +.SUFFIXES: +.SUFFIXES: .c include ../../conf.mk - M = main -PREC = s -CO_CFLAGS = `co.conf --cflags $(PREC)` -CO_LDFLAGS = `co.conf --libs $(PREC)` -ALG_LDFLAGS = `alg.conf --libs $(PREC)` - -install: $M - mkdir -p $(PREFIX)/bin - cp main $(PREFIX)/bin/co.eig2 - -$M: $M.o; $(CC) $< $(LDFLAGS) $(CO_LDFLAGS) $(ALG_LDFLAGS) -o $@ -$M.o: $M.c; $(CC) $(CFLAGS) $(CO_CFLAGS) $< -c -o $@ - -test: install; atest test/* - -.PHONY: clean test install -clean:; rm -f $M.o $M +PREC = d +CO_FLAGS = `co.conf --libs --cflags $(PREC)` +all: $M +.c:; $(CC) $< $(CFLAGS) $(CO_FLAGS) -o $@ +clean:; rm -f $M diff --git a/example/ring/Makefile b/example/ring/Makefile index c727de0a8..5d9532468 100644 --- a/example/ring/Makefile +++ b/example/ring/Makefile @@ -1,29 +1,10 @@ .POSIX: +.SUFFIXES: +.SUFFIXES: .c include ../../conf.mk M = main normal H PREC = d -CO_CFLAGS = `co.conf --cflags $(PREC)` -CO_LDFLAGS = `co.conf --libs $(PREC)` -`co.conf --libs $(PREC)` \ -`alg.conf --libs $(PREC)` \ -`co.conf --libs $(PREC)` - -LINK = $(CC) - +CO_FLAGS = `co.conf --libs --cflags $(PREC)` all: $M -.o: - $(LINK) $< $(LDFLAGS) $(CO_LDFLAGS) -o $@ - -.c.o: - $(CC) $(CFLAGS) $(CO_CFLAGS) $< -c -o $@ - -.c: -%: %.c - -lint:; make CFLAGS='-Wall -Wextra -g -O2' -test: $M; atest test/* -install: -run: $M; @co.run ./rbc - -.PHONY: clean test install run lint -clean:; rm -f $M $(M:=.o) +.c:; $(CC) $< $(CFLAGS) $(CO_FLAGS) -o $@ +clean:; rm -f $M