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

Changeset b79d450 in mainline for uspace/lib/Makefile.common


Ignore:
Timestamp:
2010-01-27T20:35:49Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
fb6f1a5
Parents:
fccc236 (diff), 95e6c4f (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:

Merge mainline changes.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/Makefile.common

    rfccc236 rb79d450  
    2828#
    2929
    30 ## Setup toolchain
     30## Common rules for building apps.
    3131#
    3232
    33 include Makefile.common
     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
     41#
     42
     43DEPEND = Makefile.depend
     44DEPEND_PREV = $(DEPEND).prev
     45
     46LIBC_PREFIX = $(USPACE_PREFIX)/lib/libc
     47
     48JOB = $(OUTPUT).job
     49
     50OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
     51
     52-include $(USPACE_PREFIX)/../Makefile.config
    3453include $(LIBC_PREFIX)/Makefile.toolchain
    3554
    36 CFLAGS += -Iinclude -Iarch/$(UARCH)/include/
     55CFLAGS += $(EXTRA_CFLAGS)
    3756
    38 ## Sources
    39 #
     57.PHONY: all build clean
    4058
    41 SOURCES = \
    42         generic/add.c \
    43         generic/common.c \
    44         generic/comparison.c \
    45         generic/conversion.c \
    46         generic/div.c \
    47         generic/mul.c \
    48         generic/other.c \
    49         generic/softfloat.c \
    50         generic/sub.c
     59all: \
     60    $(LIBC_PREFIX)/../../../version \
     61    $(LIBC_PREFIX)/../../../Makefile.config \
     62    $(LIBC_PREFIX)/../../../config.h \
     63    $(LIBC_PREFIX)/../../../config.defs \
     64    $(LIBS) \
     65    \
     66    $(OUTPUT) \
     67    $(EXTRA_OUTPUT)
     68        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    5169
    52 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
     70clean:
     71        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(EXTRA_OUTPUT) $(EXTRA_CLEAN)
     72        find . -name '*.o' -follow -exec rm \{\} \;
    5373
    54 .PHONY: all
    55 
    56 all: $(LIBSOFTFLOAT)
     74build:
    5775
    5876-include $(DEPEND)
    5977
    60 $(LIBSOFTFLOAT): $(OBJECTS)
     78$(OUTPUT): $(OBJECTS)
    6179        $(AR) rc $@ $(OBJECTS)
     80
     81%.o: %.S $(DEPEND)
     82        $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
     83ifeq ($(PRECHECK),y)
     84        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__
     85endif
     86
     87%.o: %.s $(DEPEND)
     88        $(AS) $(AFLAGS) $< -o $@
     89ifeq ($(PRECHECK),y)
     90        $(JOBFILE) $(JOB) $< $@ as asm $(AFLAGS)
     91endif
    6292
    6393%.o: %.c $(DEPEND)
     
    6797endif
    6898
    69 $(DEPEND):
     99$(DEPEND): $(PRE_DEPEND)
    70100        makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
    71101        -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
Note: See TracChangeset for help on using the changeset viewer.