Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 827d73f in mainline for uspace/srv/Makefile.common


Ignore:
Timestamp:
2010-02-12T14:09:22Z (12 years ago)
Author:
Lukas Mejdrech <lukasmejdrech@…>
Branches:
lfn, master
Children:
a70bda4
Parents:
918e9910 (diff), e70edd1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged the actual head

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/Makefile.common

    r918e9910 r827d73f  
    2828#
    2929
    30 ## Setup toolchain
     30## Common rules for building servers.
    3131#
    3232
    33 include Makefile.common
    34 include $(LIBC_PREFIX)/Makefile.toolchain
    35 include arch/$(UARCH)/Makefile.inc
    36 
    37 CFLAGS += -Iinclude
    38 LINK = arch/$(UARCH)/_link.ld
    39 
    40 ## Sources
     33# Individual makefiles set:
     34#
     35#       USPACE_PREFIX   relative path to uspace/ directory
     36#       LIBS            libraries to link with (with relative path)
     37#       EXTRA_CFLAGS    additional flags to pass to C compiler
     38#       JOB             job file name (like appname.job)
     39#       OUTPUT          output binary name (like appname)
     40#       SOURCES         list of source files
    4141#
    4242
    43 GENERIC_SOURCES = \
    44         main.c \
    45         elf_load.c \
    46         interp.s
     43DEPEND = Makefile.depend
     44DEPEND_PREV = $(DEPEND).prev
    4745
    48 SOURCES := $(GENERIC_SOURCES) $(ARCH_SOURCES)
     46LIBC_PREFIX = $(USPACE_PREFIX)/lib/libc
     47LIBBLOCK_PREFIX = $(USPACE_PREFIX)/lib/libblock
     48LIBFS_PREFIX = $(USPACE_PREFIX)/lib/libfs
     49LIBPCI_PREFIX = $(USPACE_PREFIX)/lib/libpci
     50SOFTINT_PREFIX = $(USPACE_PREFIX)/lib/softint
     51
     52LINK_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld
     53
     54JOB = $(OUTPUT).job
     55
    4956OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    5057
    51 .PHONY: all
     58include $(LIBC_PREFIX)/Makefile.toolchain
    5259
    53 all: $(OUTPUT) $(OUTPUT).disasm
     60CFLAGS += $(EXTRA_CFLAGS)
     61
     62.PHONY: all build clean
     63
     64all: \
     65    $(LIBC_PREFIX)/../../../version \
     66    $(LIBC_PREFIX)/../../../Makefile.config \
     67    $(LIBC_PREFIX)/../../../config.h \
     68    $(LIBC_PREFIX)/../../../config.defs \
     69    $(LIBS) \
     70    \
     71    $(OUTPUT) $(OUTPUT).disasm \
     72    $(EXTRA_OUTPUT)
     73        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     74
     75clean:
     76        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm $(EXTRA_OUTPUT)
     77        find . -name '*.o' -follow -exec rm \{\} \;
     78
     79build:
    5480
    5581-include $(DEPEND)
     
    5884        $(OBJDUMP) -d $< > $@
    5985
    60 $(OUTPUT): $(OBJECTS) $(LIBS) $(LINK)
    61         $(LD) -T $(LINK) $(LFLAGS) $(OBJECTS) $(LIBS) -o $@ -Map $(OUTPUT).map
    62 
    63 $(LINK): $(LINK).in
    64         $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
     86$(OUTPUT): $(LINK_SCRIPT) $(OBJECTS) $(LIBS)
     87        $(LD) -T $(LINK_SCRIPT) $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
    6588
    6689%.o: %.c $(DEPEND)
    6790        $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
    68 
    69 %.o: %.s $(DEPEND)
    70         $(AS) $(AFLAGS) $< -o $@
     91ifeq ($(PRECHECK),y)
     92        $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
     93endif
    7194
    7295$(DEPEND):
Note: See TracChangeset for help on using the changeset viewer.