Skip to content

Commit

Permalink
update more Makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
slitvinov committed Mar 13, 2024
1 parent cbfb1c2 commit 5a94975
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 41 deletions.
25 changes: 8 additions & 17 deletions bin/eigenvector2/Makefile
Original file line number Diff line number Diff line change
@@ -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
29 changes: 5 additions & 24 deletions example/ring/Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5a94975

Please sign in to comment.