Statistics
| Branch: | Revision:

scoutos / prex-0.9.0 / mk / prog.mk @ 03e9c04a

History | View | Annotate | Download (711 Bytes)

1
# Rules to compile a POSIX executable file
2

    
3
include $(SRCDIR)/mk/own.mk
4

    
5
INCSDIR+=	$(SRCDIR)/usr/include
6
LIBSDIR+=	$(SRCDIR)/usr/lib
7
CRT0:=		$(SRCDIR)/usr/lib/crt0.o
8
LIBC:=		$(SRCDIR)/usr/lib/libc.a
9

    
10
ifeq ($(CONFIG_MMU),y)
11
LDSCRIPT:=	$(SRCDIR)/usr/arch/$(ARCH)/user.ld
12
STRIPFLAG:=	-s
13
else
14
LDSCRIPT:=	$(SRCDIR)/usr/arch/$(ARCH)/user-nommu.ld
15
STRIPFLAG:=	--strip-debug --strip-unneeded
16
_RELOC_OBJ_:=	1
17
endif
18

    
19
ifdef PROG
20
TARGET?=	$(PROG)
21
ifndef SRCS
22
SRCS:=		$(basename $(PROG)).c
23
endif
24
endif
25

    
26
include $(SRCDIR)/mk/common.mk
27

    
28
$(TARGET): $(LIBS) $(OBJS)
29
	$(call echo-file,LD     ,$@)
30
	$(LD) $(LDFLAGS) $(OUTPUT_OPTION) $(CRT0) $(OBJS) $(LIBS) $(LIBC) $(PLATFORM_LIBS)
31
	$(ASMGEN)
32
	$(SYMGEN)
33
	$(STRIP) $(STRIPFLAG) $@