Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/loader/Makefile

    r8786aa5 rfcd7053  
    11#
    22# Copyright (c) 2005 Martin Decky
    3 # Copyright (c) 2007 Jakub Jermar
     3# Copyright (c) 2008 Jiri Svoboda
    44# All rights reserved.
    55#
     
    2828#
    2929
    30 include Makefile.common
     30## Setup toolchain
     31#
    3132
    32 .PHONY: all clean
     33LIBC_PREFIX = ../../lib/libc
     34SOFTINT_PREFIX = ../../lib/softint
    3335
    34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
    35         -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    36         $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
     36include $(LIBC_PREFIX)/Makefile.toolchain
     37include arch/$(UARCH)/Makefile.inc
     38
     39CFLAGS += -Iinclude
     40
     41LIBS = $(LIBC_PREFIX)/libc.a $(SOFTINT_PREFIX)/libsoftint.a
     42
     43## Sources
     44#
     45
     46OUTPUT = loader
     47GENERIC_SOURCES = \
     48        main.c \
     49        elf_load.c \
     50        interp.s
     51
     52SOURCES := $(GENERIC_SOURCES) $(ARCH_SOURCES)
     53OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
     54
     55.PHONY: all clean depend disasm
     56
     57all: $(OUTPUT) disasm
     58
     59-include Makefile.depend
    3760
    3861clean:
    39         rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm arch/*/_link.ld
    40         find . -name '*.o' -follow -exec rm \{\} \;
     62        -rm -f $(OUTPUT) $(OBJECTS) $(OUTPUT).map $(OUTPUT).disasm arch/$(UARCH)/_link.ld Makefile.depend
     63
     64depend:
     65        $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
     66
     67$(OUTPUT): $(OBJECTS) $(LIBS) arch/$(UARCH)/_link.ld
     68        $(LD) -T arch/$(UARCH)/_link.ld $(LFLAGS) $(OBJECTS) $(LIBS) -o $@ -Map $(OUTPUT).map
     69
     70disasm:
     71        $(OBJDUMP) -d $(OUTPUT) >$(OUTPUT).disasm
     72
     73arch/$(UARCH)/_link.ld: arch/$(UARCH)/_link.ld.in
     74        $(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
     75
     76%.o: %.S
     77        $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
     78
     79%.o: %.s
     80        $(AS) $(AFLAGS) $< -o $@
     81
     82%.o: %.c
     83        $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
Note: See TracChangeset for help on using the changeset viewer.