modified: pixi.toml
[GalaxyCodeBases.git] / released / pIRS.old / bwasam / Makefile
blob2030d2537c6883cc88437d23c7fddf127324555d
1 # learned from http://sourceforge.net/projects/gcmakefile/
2 # The options used in linking as well as in any direct use of ld.
3 LDLIB = #-lpthread
5 LDFLAGS = -Wl,-O1 -Wl,--sort-common -Wl,--enable-new-dtags -Wl,--hash-style=both $(LDLIB)
6 # The directories in which source files reside.
7 # If not specified, only the current directory will be serached.
8 SRCDIRS =
10 ## Implicit Section: change the following only when necessary.
11 ##==========================================================================
13 # The source file types (headers excluded).
14 # .c indicates C source files, and others C++ ones.
15 SRCEXTS = .c# .C .cc .cpp .CPP .c++ .cxx .cp
17 OLevel= -O3
18 CFLAGS = -pipe -march=core2 -mtune=generic -std=gnu99
19 WARNFLAGS = -Wfloat-equal -Wall\
20 #-pedantic
22 ASMFLAGS = -S -fverbose-asm -g -masm=intel
24 ifeq ($(SRCDIRS),)
25 SRCDIRS = .
26 endif
28 SOURCES = $(foreach d,$(SRCDIRS),$(wildcard $(addprefix $(d)/*,$(SRCEXTS))))
30 .PHONY: all clean debug
32 all: $(SOURCES:.c=)
33 #$(patsubst $.c,%,$(SOURCES))
34 @echo [@gcc $(CFLAGS) $(OLevel) $(LDFLAGS)]
35 #@echo [$(SOURCES)] to [$(SOURCES:.c=)].
37 debug: clean all
38 debug: override WARNFLAGS += -D DEBUG -g
39 debug: override OLevel = -O1
41 %: %.c
42 @mkdir -p asm
43 @echo [$(OLevel) $(WARNFLAGS)]: ${<} -\> ${@}
44 @gcc $(WARNFLAGS) $(CFLAGS) $(OLevel) $(LDFLAGS) -o $@ $<
45 @gcc $(CFLAGS) $(OLevel) $(LDFLAGS) $(ASMFLAGS) -o ./asm/$@.s $<
46 @as -alhnd -o /dev/null ./asm/$@.s > ./asm/$@.asm
47 #@gcc $(CFLAGS) $(OLevel) $(LDFLAGS) $(ASMFLAGS) -o - $< | as -alhnd > ./asm/$@.asm
48 @rm ./asm/$@.s
50 ./dupsamstat: override LDLIB += -lbam -lm
52 clean:
53 -rm $(SOURCES:.c=)
54 -rm -frv ./asm