9 CFLAGS
:= -I
$(IDIR
) -O2
-fno-builtin
-nostartfiles
-nostdlib
-Wall
-masm
=intel
-march
=btver2
-mtune
=btver2
-m64
-mabi
=sysv
-mcmodel
=large
10 SFLAGS
:= -nostartfiles
-nostdlib
-march
=btver2
-mtune
=btver2
11 CFILES
:= $(wildcard $(SDIR
)/*.c
)
12 SFILES
:= $(wildcard $(SDIR
)/*.s
)
13 OBJS
:= $(patsubst $(SDIR
)/%.c
, build
/%.o
, $(CFILES
)) $(patsubst $(SDIR
)/%.s
, build
/%.o
, $(SFILES
))
15 TARGET
= lib
$(shell basename $(CURDIR
)).a
17 $(TARGET
): $(ODIR
) $(OBJS
)
20 $(ODIR
)/%.o
: $(SDIR
)/%.c
21 $(CC
) -c
-o
$@
$< $(CFLAGS
)
23 $(ODIR
)/%.o
: $(SDIR
)/%.s
24 $(AS
) -c
-o
$@
$< $(SFLAGS
)
32 rm -f
$(TARGET
) $(ODIR
)/*.o