Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/loader/Makefile

    rfcd7053 r8786aa5  
    11#
    22# Copyright (c) 2005 Martin Decky
    3 # Copyright (c) 2008 Jiri Svoboda
     3# Copyright (c) 2007 Jakub Jermar
    44# All rights reserved.
    55#
     
    2828#
    2929
    30 ## Setup toolchain
    31 #
     30include Makefile.common
    3231
    33 LIBC_PREFIX = ../../lib/libc
    34 SOFTINT_PREFIX = ../../lib/softint
     32.PHONY: all clean
    3533
    36 include $(LIBC_PREFIX)/Makefile.toolchain
    37 include arch/$(UARCH)/Makefile.inc
    38 
    39 CFLAGS += -Iinclude
    40 
    41 LIBS = $(LIBC_PREFIX)/libc.a $(SOFTINT_PREFIX)/libsoftint.a
    42 
    43 ## Sources
    44 #
    45 
    46 OUTPUT = loader
    47 GENERIC_SOURCES = \
    48         main.c \
    49         elf_load.c \
    50         interp.s
    51 
    52 SOURCES := $(GENERIC_SOURCES) $(ARCH_SOURCES)
    53 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    54 
    55 .PHONY: all clean depend disasm
    56 
    57 all: $(OUTPUT) disasm
    58 
    59 -include Makefile.depend
     34all: $(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)
    6037
    6138clean:
    62         -rm -f $(OUTPUT) $(OBJECTS) $(OUTPUT).map $(OUTPUT).disasm arch/$(UARCH)/_link.ld Makefile.depend
    63 
    64 depend:
    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 
    70 disasm:
    71         $(OBJDUMP) -d $(OUTPUT) >$(OUTPUT).disasm
    72 
    73 arch/$(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 $@
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm arch/*/_link.ld
     40        find . -name '*.o' -follow -exec rm \{\} \;
Note: See TracChangeset for help on using the changeset viewer.