File: Makefile

package info (click to toggle)
python-peachpy 0.0~git20211013.257881e-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,452 kB
  • sloc: python: 29,286; ansic: 54; makefile: 44; cpp: 31
file content (21 lines) | stat: -rw-r--r-- 500 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
all: test
.PHONY: clean

PEACHPY_SOURCES = matmul-opt.py
C_SOURCES = matmul-ref.c test.c
OBJECTS = $(PEACHPY_SOURCES:.py=.o) $(C_SOURCES:.c=.o)
DEPENDENCIES = $(PEACHPY_SOURCES:.py=.d) $(C_SOURCES:.c=.d)

-include $(DEPENDENCIES)

%.o: %.py
	python -m peachpy.x86_64 -MMD -MF $(<:.py=.d) -o $(@:.py=.o) $<

%.o: %.c
	$(CC) -m64 -std=gnu99 $(CFLAGS) -MMD -MF $(<:.c=.d) -o $(@:.c=.o) -c $<

test: $(OBJECTS)
	$(CC) -m64 -g $(LDFLAGS) $^ -o $@ $(LDLIBS)

clean:
	-rm -f $(OBJECTS) $(DEPENDENCIES) test