4 |
# * |
# * |
5 |
# * Adapted from linux x86 Makefile by Guillaume Morin <guillaume@morinfr.org> |
# * Adapted from linux x86 Makefile by Guillaume Morin <guillaume@morinfr.org> |
6 |
# * |
# * |
|
# * Still incomplete but WIP |
|
|
# * |
|
7 |
# * libso: |
# * libso: |
8 |
# * (-lm not neccessary if using -ffast-math) |
# * (-lm not neccessary if using -ffast-math) |
9 |
# * |
# * |
20 |
CFLAGS += -Wall -O3 -funroll-loops -ffast-math |
CFLAGS += -Wall -O3 -funroll-loops -ffast-math |
21 |
CFLAGS += -fstrict-aliasing -fomit-frame-pointer |
CFLAGS += -fstrict-aliasing -fomit-frame-pointer |
22 |
|
|
23 |
|
## for profiling, uncomment the next line. |
24 |
|
#CFLAGS += -D_PROFILING_ |
25 |
|
|
26 |
|
## for debugging, comment the previous lines and uncomment the next one. |
27 |
|
#CFLAGS += -Wall -g |
28 |
|
|
29 |
|
|
30 |
AS = as |
AS = as |
31 |
|
|
32 |
%.o: %.s |
%.o: %.s |
36 |
|
|
37 |
all: $(LIB) $(LIBSO) |
all: $(LIB) $(LIBSO) |
38 |
|
|
|
|
|
39 |
$(LIB): $(SRC:.c=.o) $(SRC_PPC:.s=.o) |
$(LIB): $(SRC:.c=.o) $(SRC_PPC:.s=.o) |
40 |
ar rcs $@ $^ |
ar rcs $@ $^ |
41 |
|
|
43 |
$(LIBSO): $(SRC:.c=.o) $(SRC_PPC:.s=.o) |
$(LIBSO): $(SRC:.c=.o) $(SRC_PPC:.s=.o) |
44 |
$(CC) $(CFLAGS) $^ -shared -lc -lm -o $@ |
$(CC) $(CFLAGS) $^ -shared -lc -lm -o $@ |
45 |
|
|
|
|
|
46 |
clean: |
clean: |
47 |
$(RM) `find $(SRCDIR) -name "*.o"` |
$(RM) `find $(SRCDIR) -name "*.o"` |
48 |
|
|