1 | # |
---|
2 | # $Id$ |
---|
3 | # |
---|
4 | |
---|
5 | @SET_MAKE@ |
---|
6 | srcdir = @srcdir@ |
---|
7 | VPATH = @srcdir@ |
---|
8 | RTEMS_ROOT = @top_srcdir@ |
---|
9 | PROJECT_ROOT = @PROJECT_ROOT@ |
---|
10 | RTEMS_GAS_CODE16 = @RTEMS_GAS_CODE16@ |
---|
11 | |
---|
12 | PGMS=${ARCH}/start.o ${ARCH}/start16.bin |
---|
13 | |
---|
14 | # C source names, if any, go here -- minus the .c |
---|
15 | C_PIECES= |
---|
16 | C_FILES=$(C_PIECES:%=%.c) |
---|
17 | C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) |
---|
18 | |
---|
19 | H_FILES= |
---|
20 | |
---|
21 | # Assembly source names, if any, go here -- minus the .s |
---|
22 | S_PIECES=start16 start |
---|
23 | S_FILES=$(S_PIECES:%=%.s) |
---|
24 | S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) |
---|
25 | |
---|
26 | SRCS=$(C_FILES) $(H_FILES) $(S_FILES) |
---|
27 | OBJS=$(C_O_FILES) $(S_O_FILES) |
---|
28 | |
---|
29 | include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg |
---|
30 | include $(RTEMS_ROOT)/make/leaf.cfg |
---|
31 | |
---|
32 | # |
---|
33 | # (OPTIONAL) Add local stuff here using += |
---|
34 | # |
---|
35 | |
---|
36 | ifeq ($(RTEMS_GAS_CODE16),yes) |
---|
37 | DEFINES += -DNEW_GAS |
---|
38 | endif |
---|
39 | CPPFLAGS += |
---|
40 | CFLAGS += |
---|
41 | |
---|
42 | LD_PATHS += |
---|
43 | LD_LIBS += |
---|
44 | LDFLAGS += |
---|
45 | |
---|
46 | # |
---|
47 | # Add your list of files to delete here. The config files |
---|
48 | # already know how to delete some stuff, so you may want |
---|
49 | # to just run 'make clean' first to see what gets missed. |
---|
50 | # 'make clobber' already includes 'make clean' |
---|
51 | # |
---|
52 | |
---|
53 | CLEAN_ADDITIONS += |
---|
54 | CLOBBER_ADDITIONS += |
---|
55 | |
---|
56 | all: ${ARCH} $(SRCS) $(OBJS) $(PGMS) |
---|
57 | $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib |
---|
58 | |
---|
59 | # Install the program(s), appending _g or _p as appropriate. |
---|
60 | # for include files, just use $(INSTALL) |
---|
61 | |
---|
62 | LINKCMDS=$(srcdir)/../startup/linkcmds |
---|
63 | |
---|
64 | ${ARCH}/start16.o: start16.s |
---|
65 | sed -e 's/\/\/.*$$//' < $< | $(CPP) $(ASMFLAGS) -I. -I$(srcdir) \ |
---|
66 | -DASM -DHEADERADDR=$(HEADERADDR) - > $*.i |
---|
67 | $(AS) $(ASFLAGS) -o $@ $*.i |
---|
68 | |
---|
69 | ${ARCH}/start16.bin: ${ARCH}/start16.o |
---|
70 | $(LD) -N -T $(LINKCMDS) -Ttext $(START16ADDR) -e start16 -nostdlib \ |
---|
71 | --oformat=elf32-i386 -o $(basename $@).obj $(basename $@).o |
---|
72 | $(OBJCOPY) -O binary $(basename $@).obj $@ |
---|