2011-12-31 19:26:51 +05:30
|
|
|
CC=gcc
|
2012-01-05 23:24:14 -05:00
|
|
|
CFLAGS=-O2 -fPIC -I. -I../include -I../ld128 -I../src -D__BSD_VISIBLE -Wno-implicit-function-declaration
|
2011-12-31 12:48:43 +05:30
|
|
|
|
2011-12-31 19:26:51 +05:30
|
|
|
default: all
|
|
|
|
|
2011-12-31 12:48:43 +05:30
|
|
|
%.o: %.c
|
|
|
|
$(QUIET_CC)$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o *~
|
|
|
|
|
|
|
|
# OS-specific stuff
|
2012-01-01 15:24:23 +05:30
|
|
|
OS = $(shell uname)
|
|
|
|
ARCH = $(shell uname -m)
|
2011-12-31 12:48:43 +05:30
|
|
|
|
|
|
|
ifeq ($(OS), Linux)
|
|
|
|
SHLIB_EXT = so
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS), Darwin)
|
|
|
|
SHLIB_EXT = dylib
|
2012-01-05 23:24:14 -05:00
|
|
|
CFLAGS+=-std=c99
|
2011-12-31 12:48:43 +05:30
|
|
|
endif
|
|
|
|
|
|
|
|
# Colors for make
|
|
|
|
|
|
|
|
CCCOLOR="\033[34m"
|
|
|
|
LINKCOLOR="\033[34;1m"
|
|
|
|
SRCCOLOR="\033[33m"
|
|
|
|
BINCOLOR="\033[37;1m"
|
|
|
|
MAKECOLOR="\033[32;1m"
|
|
|
|
ENDCOLOR="\033[0m"
|
|
|
|
|
|
|
|
QUIET_CC = @printf ' %b %b\n' $(CCCOLOR)CC$(ENDCOLOR) $(SRCCOLOR)$@$(ENDCOLOR);
|
|
|
|
QUIET_LINK = @printf ' %b %b\n' $(LINKCOLOR)LINK$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR);
|