1 #include ../../Makefile.preamble
8 # may need to remove --param max-inline-insns-single=500 for older versions of gccs
9 WARN
:=-Wall
-Wstrict-prototypes
-Winline
10 #--param max-inline-insns-single=500
15 dependson
:= $(shell cat depends
) ||
""
18 others
:= $(dependson
)
19 others
:= $(addprefix -I..
/,$(others
))
20 others
:= $(addsuffix /_headers
,$(others
))
24 DLL_L
:= $(addprefix -L..
/,$(DLL_L
))
25 DLL_L
:= $(addsuffix /_dll
,$(DLL_L
))
28 DLL_l
:= $(addprefix -l
,$(DLL_l
))
30 CFLAGS
:= $(OPTIMIZE
) $(WARN
) $(HEADERS
) #--param max-inline-insns-single=500
32 # Uncommment for Coros to register their stack with Valgrind
33 #CFLAGS += -DUSE_VALGRIND
35 ### PLATFORM #####################################################
37 SYS ?
= $(shell uname
-s
)
40 CFLAGS
+= -falign-loops
=16
49 DLL_COMMAND
:= -dynamiclib
50 FLAT_NAMESPACE
:= -flat_namespace
53 DLL_COMMAND
:= -shared
57 ### FILES #########################################################
59 NAME
:= $(notdir $(shell pwd
))
60 LIBR
:= _lib
/lib
$(NAME
).a
61 DLL
:= _dll
/lib
$(NAME
).
$(DLL_SUFFIX
)
62 infiles
:= $(wildcard source
/*.c
) $(wildcard *.S
)
63 objects
:= $(notdir $(infiles
))
64 objects
:= $(basename $(objects
))
65 objects
:= $(addsuffix .o
,$(objects
))
66 objects
:= $(addprefix _objs
/,$(objects
))
68 ### RULES ###########################################################
77 cp source
/*.h _headers
80 $(CC
) $(CFLAGS
) -c
$< -o
$@
87 $(CC
) $(DLL_COMMAND
) $(FLAT_NAMESPACE
) $(DLL_L
) $(DLL_l
) $(objects
) -o
$(DLL
)