1 # learned from http://sourceforge.net/projects/gcmakefile/
2 # The options used in linking as well as in any direct use of ld.
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.
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
18 CFLAGS
= -pipe
-march
=core2
-mtune
=generic
# -std=gnu99
19 WARNFLAGS
= -Wfloat-equal
-Wall \
22 ASMFLAGS
= -S
-fverbose-asm
-g
-masm
=intel
28 SOURCES
= $(foreach d
,$(SRCDIRS
),$(wildcard $(addprefix $(d
)/*,$(SRCEXTS
))))
33 #$(patsubst $.c,%,$(SOURCES))
34 @echo
[@gcc
$(CFLAGS
) $(OLevel
) $(LDFLAGS
)]
35 #@echo [$(SOURCES)] to [$(SOURCES:.c=)].
39 @echo
[$(OLevel
)]:${<} -\
> ${@
}
40 @gcc
$(WARNFLAGS
) $(CFLAGS
) $(OLevel
) $(LDFLAGS
) -o
$@
$<
41 @gcc
$(CFLAGS
) $(OLevel
) $(LDFLAGS
) $(ASMFLAGS
) -o .
/asm
/$@.s
$<
42 @
as -alhnd .
/asm
/$@.s
> .
/asm
/$@.asm
43 #@gcc $(CFLAGS) $(OLevel) $(LDFLAGS) $(ASMFLAGS) -o - $< | as -alhnd > ./asm/$@.asm
46 .
/11locktest
: override OLevel
+=