2
0
This repository has been archived on 2025-11-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files

42 lines
1006 B
Makefile
Executable File

SRC = os_linux.c os_msgLinux.c os_log.c os_print.c
ifeq ($(INCLUDE_CDBG_DUMPSTACK),y)
SRC += os_dumpstack.c
endif
FOBJ = libos.so
OBJS = $(SRC:.c=.o)
CFLAGS = -D__LINUX_OS_FC__ -fPIC -I./include/ $(DF_FLAGS) -Wall -Werror=implicit-function-declaration
ifeq ($(INCLUDE_DUMPSTACK_UNWIND),y)
CFLAGS += -funwind-tables -I../libunwind-1.6.2/include
EXARCHIVE = ../libunwind-1.6.2/src/.libs/libunwind.a
ifeq (mips,$(ARCH))
EXARCHIVE += ../libunwind-1.6.2/src/.libs/libunwind-mips.a
endif
ifeq (arm,$(ARCH))
EXARCHIVE += ../libunwind-1.6.2/src/.libs/libunwind-arm.a
endif
ifeq (arm64,$(ARCH))
EXARCHIVE += ../libunwind-1.6.2/src/.libs/libunwind-aarch64.a
endif
endif
$(FOBJ).so: $(OBJS)
$(CC) $(CFLAGS) -shared $(OBJS) $(EXARCHIVE) -o $@
$(STRIP) $@
sinclude $(SRC:.c=.d)
%.o: ./src/%.c
$(CC) $(CFLAGS) -c -o $@ $<
%.d: ./src/%.c
@$(CC) -MM $(CFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
.PHONY : clean
clean :
$(RM) $(FOBJ) $(SRC:.c=.d) $(OBJS)