-
Notifications
You must be signed in to change notification settings - Fork 32
/
makefile
81 lines (57 loc) · 1.91 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
include config.mak
vpath %.cpp $(SRCDIR)
OBJS = $(SRCS:%.cpp=%.cpp.o)
OBJCS = $(SRCCS:%.c=%.c.o)
OBJASMS = $(ASMS:%.asm=%.o)
OBJPYWS = $(PYWS:%.pyw=%.o)
OBJRBINS = $(RBINS:%.bin=%.o)
OBJRHS = $(RHS:%.h=%.h.o)
OBJRCLS = $(RCLS:%.cl=%.o)
OBJRCLHS = $(RCLHS:%.clh=%.o)
all: $(PROGRAM)
$(PROGRAM): .depend $(OBJS) $(OBJCS) $(OBJPYWS) $(OBJRBINS) $(OBJRHS) $(OBJRCLS) $(OBJRCLHS)
$(LD) $(OBJS) $(OBJCS) $(OBJPYWS) $(OBJRBINS) $(OBJRHS) $(OBJRCLS) $(OBJRCLHS) $(LDFLAGS) -o $(PROGRAM)
%_sse2.cpp.o: %_sse2.cpp .depend
$(CXX) -c $(CXXFLAGS) -msse2 -o $@ $<
%_ssse3.cpp.o: %_ssse3.cpp .depend
$(CXX) -c $(CXXFLAGS) -mssse3 -o $@ $<
%_sse41.cpp.o: %_sse41.cpp .depend
$(CXX) -c $(CXXFLAGS) -msse4.1 -o $@ $<
%_avx.cpp.o: %_avx.cpp .depend
$(CXX) -c $(CXXFLAGS) -mavx -mpopcnt -o $@ $<
%_avx2.cpp.o: %_avx2.cpp .depend
$(CXX) -c $(CXXFLAGS) -mavx2 -mpopcnt -mbmi -mbmi2 -o $@ $<
%_avx512bw.cpp.o: %_avx512bw.cpp .depend
$(CXX) -c $(CXXFLAGS) -mavx512f -mavx512bw -mpopcnt -mbmi -mbmi2 -o $@ $<
%.cpp.o: %.cpp .depend
$(CXX) -c $(CXXFLAGS) -o $@ $<
%.c.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
%.o: %.pyw
objcopy -I binary -O elf64-x86-64 -B i386 $< $@
%.o: %.bin
objcopy -I binary -O elf64-x86-64 -B i386 $< $@
%.h.o: %.h
objcopy -I binary -O elf64-x86-64 -B i386 $< $@
%.o: %.cl
objcopy -I binary -O elf64-x86-64 -B i386 $< $@
%.o: %.clh
objcopy -I binary -O elf64-x86-64 -B i386 $< $@
.depend: config.mak
@rm -f .depend
@echo 'generate .depend...'
@$(foreach SRC, $(SRCS:%=$(SRCDIR)/%), $(CXX) $(SRC) $(CXXFLAGS) -g0 -MT $(SRC:$(SRCDIR)/%.cpp=%.o) -MM >> .depend;)
ifneq ($(wildcard .depend),)
include .depend
endif
clean:
rm -f $(OBJS) $(OBJCS) $(OBJPYWS) $(OBJRBINS) $(OBJRHS) $(OBJRCLS) $(OBJRCLHS) $(PROGRAM) .depend
distclean: clean
rm -f config.mak QSVPipeline/rgy_config.h
install:
install -d $(PREFIX)/bin
install -m 755 $(PROGRAM) $(PREFIX)/bin
uninstall:
rm -f $(PREFIX)/bin/$(PROGRAM)
config.mak:
./configure