Changeset 4e9aaf5 in mainline


Ignore:
Timestamp:
2010-03-19T18:30:12Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8023571, b535aeb, e2b73d4f
Parents:
3c80f2b
Message:

more autotooling: run actually the compiler in autotool.py and detect sizes of integers, generate common.h
more build system cleanup: remove redundancy, remove config.defs, merge kernel makefiles to a single file

Files:
2 deleted
25 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r3c80f2b r4e9aaf5  
    2727#
    2828
    29 ## Include configuration
    30 #
    31 
    3229CSCOPE = cscope
    3330CONFIG = tools/config.py
    3431AUTOTOOL = tools/autotool.py
     32SANDBOX = autotool
     33
     34CONFIG_RULES = HelenOS.config
     35
     36COMMON_MAKEFILE = Makefile.common
     37COMMON_HEADER = common.h
     38COMMON_HEADER_PREV = $(COMMON_HEADER).prev
     39
     40CONFIG_MAKEFILE = Makefile.config
     41CONFIG_HEADER = config.h
    3542
    3643.PHONY: all precheck cscope autotool config_default config distclean clean
    3744
    38 all: Makefile.common Makefile.config config.h config.defs
     45all: $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER)
     46        cp -a $(COMMON_HEADER) $(COMMON_HEADER_PREV)
    3947        $(MAKE) -C kernel PRECHECK=$(PRECHECK)
    4048        $(MAKE) -C uspace PRECHECK=$(PRECHECK)
     
    4755        find kernel boot uspace -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE).out
    4856
    49 Makefile.common: autotool
     57$(COMMON_MAKEFILE): autotool
     58$(COMMON_HEADER): autotool
    5059
    51 autotool: Makefile.config
     60autotool: $(CONFIG_MAKEFILE)
    5261        $(AUTOTOOL)
     62        -[ -f $(COMMON_HEADER_PREV) ] && diff -q $(COMMON_HEADER_PREV) $(COMMON_HEADER) && mv -f $(COMMON_HEADER_PREV) $(COMMON_HEADER)
    5363
    54 Makefile.config: config_default
     64$(CONFIG_MAKEFILE): config_default
     65$(CONFIG_HEADER): config_default
    5566
    56 config.h: config_default
     67config_default: $(CONFIG_RULES)
     68        $(CONFIG) $< default
    5769
    58 config.defs: config_default
    59 
    60 config_default: HelenOS.config
    61         $(CONFIG) HelenOS.config default
    62 
    63 config: HelenOS.config
    64         $(CONFIG) HelenOS.config
     70config: $(CONFIG_RULES)
     71        $(CONFIG) $<
    6572
    6673distclean: clean
    67         rm -f $(CSCOPE).out Makefile.common Makefile.config config.h config.defs tools/*.pyc tools/checkers/*.pyc
     74        rm -f $(CSCOPE).out $(COMMON_MAKEFILE) $(COMMON_HEADER) $(COMMON_HEADER_PREV) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) tools/*.pyc tools/checkers/*.pyc
    6875
    6976clean:
     77        rm -fr $(SANDBOX)
    7078        $(MAKE) -C kernel clean
    7179        $(MAKE) -C uspace clean
  • boot/Makefile

    r3c80f2b r4e9aaf5  
    3232-include ../Makefile.common
    3333-include ../Makefile.config
    34 -include ../config.defs
    3534
    3635## Paths
     
    4342.PHONY: all build clean generic_clean
    4443
    45 all: ../Makefile.common ../Makefile.config ../config.h ../config.defs build
     44all: ../Makefile.common ../Makefile.config ../config.h build
    4645
    4746-include arch/$(BARCH)/Makefile.inc
  • boot/arch/arm32/loader/Makefile

    r3c80f2b r4e9aaf5  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h ../../../../config.defs
     34all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • boot/arch/arm32/loader/Makefile.build

    r3c80f2b r4e9aaf5  
    3434include ../../../../Makefile.common
    3535include ../../../../Makefile.config
    36 include ../../../../config.defs
    3736include Makefile.common
    3837include Makefile.toolchain
  • boot/arch/ia64/loader/Makefile

    r3c80f2b r4e9aaf5  
    3434.PHONY: all clean
    3535
    36 all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h ../../../../config.defs
     36all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
    3737        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3838        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • boot/arch/ia64/loader/Makefile.build

    r3c80f2b r4e9aaf5  
    3434include ../../../../Makefile.common
    3535include ../../../../Makefile.config
    36 include ../../../../config.defs
    3736include Makefile.common
    3837include Makefile.toolchain
  • boot/arch/mips32/loader/Makefile

    r3c80f2b r4e9aaf5  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h ../../../../config.defs
     34all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • boot/arch/mips32/loader/Makefile.build

    r3c80f2b r4e9aaf5  
    3434include ../../../../Makefile.common
    3535include ../../../../Makefile.config
    36 include ../../../../config.defs
    3736include Makefile.common
    3837include Makefile.toolchain
  • boot/arch/ppc32/loader/Makefile

    r3c80f2b r4e9aaf5  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h ../../../../config.defs
     34all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • boot/arch/ppc32/loader/Makefile.build

    r3c80f2b r4e9aaf5  
    3434include ../../../../Makefile.common
    3535include ../../../../Makefile.config
    36 include ../../../../config.defs
    3736include Makefile.common
    3837include Makefile.toolchain
  • boot/arch/sparc64/loader/Makefile

    r3c80f2b r4e9aaf5  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h ../../../../config.defs
     34all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • boot/arch/sparc64/loader/Makefile.build

    r3c80f2b r4e9aaf5  
    3434include ../../../../Makefile.common
    3535include ../../../../Makefile.config
    36 include ../../../../config.defs
    3736include Makefile.common
    3837include Makefile.toolchain
  • kernel/Makefile

    r3c80f2b r4e9aaf5  
    2727#
    2828
    29 include Makefile.common
     29## Configuration
     30#
     31
     32ROOT_PATH = ..
     33
     34VERSION_DEF = $(ROOT_PATH)/version
     35
     36COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
     37COMMON_HEADER = $(ROOT_PATH)/common.h
     38COMMON_HEADER_ARCH = arch/$(KARCH)/include/common.h
     39
     40CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
     41CONFIG_HEADER = $(ROOT_PATH)/config.h
     42
     43-include $(VERSION_DEF)
     44-include $(COMMON_MAKEFILE)
     45-include $(CONFIG_MAKEFILE)
     46
     47## Common names
     48#
     49
     50DEPEND = Makefile.depend
     51DEPEND_PREV = $(DEPEND).prev
     52RAW = kernel.raw
     53BIN = kernel.bin
     54MAP = kernel.map
     55JOB = kernel.job
     56MAP_PREV = $(MAP).prev
     57DISASM = kernel.disasm
     58DUMP = kernel.dump
     59REAL_MAP = generic/src/debug/real_map
     60
     61ARCH_INCLUDE = generic/include/arch
     62GENARCH_INCLUDE = generic/include/genarch
     63
     64GENMAP = tools/genmap.py
     65JOBFILE = $(ROOT_PATH)/tools/jobfile.py
     66
     67LINK = arch/$(KARCH)/_link.ld
     68EMPTY_MAP = generic/src/debug/empty_map.o
     69SIZEOK_MAP = generic/src/debug/sizeok_map.o
     70
     71INCLUDES = generic/include
     72OPTIMIZATION = 3
    3073
    3174.PHONY: all clean
    3275
    33 all: ../version ../Makefile.common ../Makefile.config ../config.h ../config.defs
    34         -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    35         $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
     76all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(BIN) $(DISASM)
     77        -[ -f $(DEPEND) ] && cp -a $(DEPEND) $(DEPEND_PREV)
    3678
    3779clean:
    38         rm -f $(DEPEND) $(DEPEND_PREV) $(RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* $(ARCH_INCLUDE) $(GENARCH_INCLUDE) arch/*/_link.ld
     80        rm -f $(DEPEND) $(DEPEND_PREV) $(RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* $(ARCH_INCLUDE) $(GENARCH_INCLUDE) arch/*/_link.ld arch/*/include/common.h
    3981        find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
     82
     83## Common compiler flags
     84#
     85
     86DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
     87
     88GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
     89        -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
     90        -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
     91        -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
     92        -Werror-implicit-function-declaration -Wwrite-strings \
     93        -Werror -pipe
     94
     95ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
     96        -ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wmissing-prototypes \
     97        -Werror-implicit-function-declaration -Werror -wd170
     98
     99SUNCC_CFLAGS = -I$(INCLUDES) -xO$(OPTIMIZATION) \
     100        -xnolib -xc99=all -features=extensions \
     101        -erroff=E_ZERO_SIZED_STRUCT_UNION
     102
     103CLANG_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
     104        -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
     105        -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
     106        -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
     107        -Werror-implicit-function-declaration -Wwrite-strings \
     108        -pipe -arch $(CLANG_ARCH)
     109
     110LFLAGS = -M
     111AFLAGS =
     112
     113-include arch/$(KARCH)/Makefile.inc
     114-include genarch/Makefile.inc
     115-include $(DEPEND)
     116
     117## The at-sign
     118#
     119# The $(ATSIGN) variable holds the ASCII character representing the at-sign
     120# ('@') used in various $(AS) constructs (e.g. @progbits). On architectures that
     121# don't use '@' for starting a comment, $(ATSIGN) is merely '@'. However, on
     122# those that do use it for starting a comment (e.g. arm32), $(ATSIGN) must be
     123# defined as the percentile-sign ('%') in the architecture-dependent
     124# Makefile.inc.
     125#
     126
     127ATSIGN ?= @
     128
     129## Cross-platform assembly to start a symtab.data section
     130#
     131
     132SYMTAB_SECTION = ".section symtab.data, \"a\", $(ATSIGN)progbits;"
     133
     134## Compilation options
     135#
     136
     137ifeq ($(COMPILER),gcc_native)
     138        CFLAGS = $(GCC_CFLAGS)
     139        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     140endif
     141
     142ifeq ($(COMPILER),gcc_cross)
     143        CFLAGS = $(GCC_CFLAGS)
     144        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     145endif
     146
     147ifeq ($(COMPILER),icc)
     148        CFLAGS = $(ICC_CFLAGS)
     149        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     150endif
     151
     152ifeq ($(COMPILER),suncc)
     153        CFLAGS = $(SUNCC_CFLAGS)
     154        DEFS += $(CONFIG_DEFS)
     155        DEPEND_DEFS = $(DEFS)
     156endif
     157
     158ifeq ($(COMPILER),clang)
     159        CFLAGS = $(CLANG_CFLAGS)
     160        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     161endif
     162
     163## Generic kernel sources
     164#
     165
     166GENERIC_SOURCES = \
     167        generic/src/adt/avl.c \
     168        generic/src/adt/bitmap.c \
     169        generic/src/adt/btree.c \
     170        generic/src/adt/hash_table.c \
     171        generic/src/adt/list.c \
     172        generic/src/console/chardev.c \
     173        generic/src/console/console.c \
     174        generic/src/cpu/cpu.c \
     175        generic/src/ddi/ddi.c \
     176        generic/src/ddi/irq.c \
     177        generic/src/ddi/device.c \
     178        generic/src/debug/symtab.c \
     179        generic/src/debug/stacktrace.c \
     180        generic/src/interrupt/interrupt.c \
     181        generic/src/main/main.c \
     182        generic/src/main/kinit.c \
     183        generic/src/main/uinit.c \
     184        generic/src/main/version.c \
     185        generic/src/main/shutdown.c \
     186        generic/src/proc/program.c \
     187        generic/src/proc/scheduler.c \
     188        generic/src/proc/thread.c \
     189        generic/src/proc/task.c \
     190        generic/src/proc/the.c \
     191        generic/src/proc/tasklet.c \
     192        generic/src/syscall/syscall.c \
     193        generic/src/syscall/copy.c \
     194        generic/src/mm/buddy.c \
     195        generic/src/mm/frame.c \
     196        generic/src/mm/page.c \
     197        generic/src/mm/tlb.c \
     198        generic/src/mm/as.c \
     199        generic/src/mm/backend_anon.c \
     200        generic/src/mm/backend_elf.c \
     201        generic/src/mm/backend_phys.c \
     202        generic/src/mm/slab.c \
     203        generic/src/lib/func.c \
     204        generic/src/lib/memstr.c \
     205        generic/src/lib/sort.c \
     206        generic/src/lib/string.c \
     207        generic/src/lib/elf.c \
     208        generic/src/lib/rd.c \
     209        generic/src/printf/printf_core.c \
     210        generic/src/printf/printf.c \
     211        generic/src/printf/snprintf.c \
     212        generic/src/printf/vprintf.c \
     213        generic/src/printf/vsnprintf.c \
     214        generic/src/time/clock.c \
     215        generic/src/time/timeout.c \
     216        generic/src/time/delay.c \
     217        generic/src/preempt/preemption.c \
     218        generic/src/synch/spinlock.c \
     219        generic/src/synch/condvar.c \
     220        generic/src/synch/rwlock.c \
     221        generic/src/synch/mutex.c \
     222        generic/src/synch/semaphore.c \
     223        generic/src/synch/smc.c \
     224        generic/src/synch/waitq.c \
     225        generic/src/synch/futex.c \
     226        generic/src/smp/ipi.c \
     227        generic/src/smp/smp.c \
     228        generic/src/ipc/ipc.c \
     229        generic/src/ipc/sysipc.c \
     230        generic/src/ipc/ipcrsc.c \
     231        generic/src/ipc/irq.c \
     232        generic/src/ipc/event.c \
     233        generic/src/security/cap.c \
     234        generic/src/sysinfo/sysinfo.c
     235
     236## Kernel console support
     237#
     238
     239ifeq ($(CONFIG_KCONSOLE),y)
     240GENERIC_SOURCES += \
     241        generic/src/console/kconsole.c \
     242        generic/src/console/cmd.c
     243endif
     244
     245## Udebug interface sources
     246#
     247
     248ifeq ($(CONFIG_UDEBUG),y)
     249GENERIC_SOURCES += \
     250        generic/src/ipc/kbox.c \
     251        generic/src/udebug/udebug.c \
     252        generic/src/udebug/udebug_ops.c \
     253        generic/src/udebug/udebug_ipc.c
     254endif
     255
     256## Test sources
     257#
     258
     259ifeq ($(CONFIG_TEST),y)
     260        CFLAGS += -Itest/
     261        GENERIC_SOURCES += \
     262                test/test.c \
     263                test/atomic/atomic1.c \
     264                test/btree/btree1.c \
     265                test/avltree/avltree1.c \
     266                test/fault/fault1.c \
     267                test/mm/falloc1.c \
     268                test/mm/falloc2.c \
     269                test/mm/mapping1.c \
     270                test/mm/slab1.c \
     271                test/mm/slab2.c \
     272                test/synch/rwlock1.c \
     273                test/synch/rwlock2.c \
     274                test/synch/rwlock3.c \
     275                test/synch/rwlock4.c \
     276                test/synch/rwlock5.c \
     277                test/synch/semaphore1.c \
     278                test/synch/semaphore2.c \
     279                test/print/print1.c \
     280                test/print/print2.c \
     281                test/print/print3.c \
     282                test/print/print4.c \
     283                test/thread/thread1.c \
     284                test/sysinfo/sysinfo1.c
     285       
     286        ifeq ($(KARCH),mips32)
     287                GENERIC_SOURCES += test/debug/mips1.c
     288        else
     289                GENERIC_SOURCES += test/debug/mips1_skip.c
     290        endif
     291       
     292        ifeq ($(KARCH),ia64)
     293                GENERIC_SOURCES += test/mm/purge1.c
     294        else
     295                GENERIC_SOURCES += test/mm/purge1_skip.c
     296        endif
     297       
     298        ifeq ($(CONFIG_FPU),y)
     299                ifeq ($(KARCH),ia32)
     300                        TEST_FPU1 = y
     301                        TEST_SSE1 = y
     302                        GENERIC_SOURCES += test/fpu/fpu1_x86.c
     303                endif
     304               
     305                ifeq ($(KARCH),amd64)
     306                        TEST_FPU1 = y
     307                        TEST_SSE1 = y
     308                        GENERIC_SOURCES += test/fpu/fpu1_x86.c
     309                endif
     310               
     311                ifeq ($(KARCH),ia64)
     312                        TEST_FPU1 = y
     313                        GENERIC_SOURCES += test/fpu/fpu1_ia64.c
     314                endif
     315               
     316                ifeq ($(KARCH),mips32)
     317                        TEST_MIPS2 = y
     318                endif
     319        endif
     320       
     321        ifneq ($(TEST_FPU1),y)
     322                GENERIC_SOURCES += test/fpu/fpu1_skip.c
     323        endif
     324       
     325        ifeq ($(TEST_SSE1),y)
     326                GENERIC_SOURCES += test/fpu/sse1.c
     327        else
     328                GENERIC_SOURCES += test/fpu/sse1_skip.c
     329        endif
     330       
     331        ifeq ($(TEST_MIPS2),y)
     332                GENERIC_SOURCES += test/fpu/mips2.c
     333        else
     334                GENERIC_SOURCES += test/fpu/mips2_skip.c
     335        endif
     336       
     337endif
     338
     339GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
     340ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
     341GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
     342
     343ifeq ($(CONFIG_SYMTAB),y)
     344        SYMTAB_OBJECTS := generic/src/debug/real_map.o
     345else
     346        SYMTAB_OBJECTS :=
     347endif
     348
     349
     350
     351$(BIN): $(RAW)
     352        $(OBJCOPY) -O $(BFD) $< $@
     353
     354$(DISASM): $(RAW)
     355        $(OBJDUMP) -d $< > $@
     356
     357$(RAW): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS)
     358        $(LD) -T $(LINK) $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS) -o $@ -Map $(MAP)
     359
     360$(LINK): $(LINK).in $(DEPEND)
     361        $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
     362
     363%.o: %.S $(DEPEND)
     364        $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c $< -o $@
     365ifeq ($(PRECHECK),y)
     366        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(GCC_CFLAGS) -D__ASM__
     367endif
     368
     369%.o: %.s $(DEPEND)
     370        $(AS) $(AFLAGS) $< -o $@
     371ifeq ($(PRECHECK),y)
     372        $(JOBFILE) $(JOB) $< $@ as asm $(DEFS) $(CFLAGS) $(EXTRA_FLAGS)
     373endif
     374
     375#
     376# The FPU tests are the only objects for which we allow the compiler to generate
     377# FPU instructions.
     378#
     379
     380test/fpu/%.o: test/fpu/%.c $(DEPEND)
     381        $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) -c $< -o $@
     382ifeq ($(PRECHECK),y)
     383        $(JOBFILE) $(JOB) $< $@ cc test $(DEFS) $(CFLAGS) $(EXTRA_FLAGS)
     384endif
     385
     386#
     387# Ordinary objects.
     388#
     389
     390%.o: %.c $(DEPEND)
     391        $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) -c $< -o $@
     392ifeq ($(PRECHECK),y)
     393        $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS)
     394endif
     395
     396$(REAL_MAP).o: $(REAL_MAP).bin
     397        echo $(SYMTAB_SECTION)" .incbin \"$<\"" | $(AS) $(AFLAGS) -o $@
     398
     399$(REAL_MAP).bin: $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
     400        echo $(SYMTAB_SECTION) | $(AS) $(AFLAGS) -o $(EMPTY_MAP)
     401        $(LD) -T $(LINK) $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP) -o $@ -Map $(MAP_PREV)
     402        $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > $(DUMP)
     403        $(GENMAP) $(MAP_PREV) $(DUMP) $@
     404       
     405        # Do it once again, this time to get correct even the symbols
     406        # on architectures that have bss after symtab
     407       
     408        echo $(SYMTAB_SECTION)" .incbin \"$@\"" | $(AS) $(AFLAGS) -o $(SIZEOK_MAP)
     409        $(LD) -T $(LINK) $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP) -o $@ -Map $(MAP_PREV)
     410        $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > $(DUMP)
     411        $(GENMAP) $(MAP_PREV) $(DUMP) $@
     412
     413$(DEPEND): $(ARCH_INCLUDE) $(GENARCH_INCLUDE) $(COMMON_HEADER_ARCH)
     414        makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > $@ 2> /dev/null
     415        -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
     416
     417$(ARCH_INCLUDE): arch/$(KARCH)/include/
     418        ln -sfn ../../$< $@
     419
     420$(GENARCH_INCLUDE): genarch/include/
     421        ln -sfn ../../$< $@
     422
     423$(COMMON_HEADER_ARCH): $(COMMON_HEADER)
     424        ln -sfn ../../../$< $@
  • kernel/arch/ia32/Makefile.inc

    r3c80f2b r4e9aaf5  
    4848        SUNCC_CFLAGS += -xarch=ssea
    4949endif
     50
    5051ifeq ($(PROCESSOR),athlon_mp)
    5152        CMN2 = -march=athlon-mp
    5253        SUNCC_CFLAGS += xarch=ssea
    5354endif
     55
    5456ifeq ($(PROCESSOR),pentium3)
    5557        CMN2 = -march=pentium3
    5658        SUNCC_CFLAGS += -xarch=sse
    5759endif
     60
    5861ifeq ($(PROCESSOR),pentium4)
    5962        CMN2 = -march=pentium4
    6063        SUNCC_CFLAGS += -xarch=sse2
    6164endif
     65
    6266ifeq ($(PROCESSOR),core)
    6367        CMN2 = -march=prescott
  • kernel/arch/ia32/include/types.h

    r3c80f2b r4e9aaf5  
    2727 */
    2828
    29 /** @addtogroup ia32   
     29/** @addtogroup ia32
    3030 * @{
    3131 */
     
    3636#define KERN_ia32_TYPES_H_
    3737
    38 typedef signed char int8_t;
    39 typedef signed short int16_t;
    40 typedef signed long int32_t;
    41 typedef signed long long int64_t;
    42 
    43 typedef unsigned char uint8_t;
    44 typedef unsigned short uint16_t;
    45 typedef unsigned long uint32_t;
    46 typedef unsigned long long uint64_t;
     38#include <arch/common.h>
    4739
    4840typedef uint32_t size_t;
  • kernel/tools/genmap.py

    r3c80f2b r4e9aaf5  
    7979                        continue
    8080       
    81         return {'text' : funcs, 'bss' : bss, 'data' : data }
     81        return {'text' : funcs, 'bss' : bss, 'data' : data}
    8282
    8383def generate(kmapf, obmapf, out):
  • tools/autotool.py

    r3c80f2b r4e9aaf5  
    3434import sys
    3535import os
     36import shutil
    3637import re
    3738import time
    3839import subprocess
    3940
    40 MAKEFILE = 'Makefile.config'
    41 COMMON = 'Makefile.common'
     41SANDBOX = 'autotool'
     42CONFIG = 'Makefile.config'
     43MAKEFILE = 'Makefile.common'
     44HEADER = 'common.h'
     45GUARD = 'AUTOTOOL_COMMON_H_'
     46
     47PROBE_SOURCE = 'probe.c'
     48PROBE_OUTPUT = 'probe.s'
    4249
    4350PACKAGE_BINUTILS = "usually part of binutils"
    4451PACKAGE_GCC = "preferably version 4.4.3 or newer"
    4552PACKAGE_CROSS = "use tools/toolchain.sh to build the cross-compiler toolchain"
     53
     54COMPILER_FAIL = "The compiler is probably not capable to compile HelenOS."
     55
     56PROBE_HEAD = """#define AUTOTOOL_DECLARE(category, subcategory, name, value) \\
     57        asm volatile ( \\
     58                "AUTOTOOL_DECLARE\\t" category "\\t" subcategory "\\t" name "\\t%[val]\\n" \\
     59                : \\
     60                : [val] "n" (value) \\
     61        )
     62
     63#define DECLARE_INTSIZE(type) \\
     64        AUTOTOOL_DECLARE("intsize", "unsigned", #type, sizeof(unsigned type)); \\
     65        AUTOTOOL_DECLARE("intsize", "signed", #type, sizeof(signed type))
     66
     67int main(int argc, char *argv[])
     68{
     69"""
     70
     71PROBE_TAIL = """}
     72"""
    4673
    4774def read_config(fname, config):
     
    7097        sys.exit(1)
    7198
     99def sandbox_enter():
     100        "Create a temporal sandbox directory for running tests"
     101       
     102        if (os.path.exists(SANDBOX)):
     103                if (os.path.isdir(SANDBOX)):
     104                        try:
     105                                shutil.rmtree(SANDBOX)
     106                        except:
     107                                print_error(["Unable to cleanup the directory \"%s\"." % SANDBOX])
     108                else:
     109                        print_error(["Please inspect and remove unexpected directory,",
     110                                     "entry \"%s\"." % SANDBOX])
     111       
     112        try:
     113                os.mkdir(SANDBOX)
     114        except:
     115                print_error(["Unable to create sandbox directory \"%s\"." % SANDBOX])
     116       
     117        owd = os.getcwd()
     118        os.chdir(SANDBOX)
     119       
     120        return owd
     121
     122def sandbox_leave(owd):
     123        "Leave the temporal sandbox directory"
     124       
     125        os.chdir(owd)
     126
    72127def check_config(config, key):
    73128        "Check whether the configuration key exists"
     
    77132                             "Try running \"make config\" again.",
    78133                             "If the problem persists, please contact the developers of HelenOS."])
     134
     135def check_common(common, key):
     136        "Check whether the common key exists"
     137       
     138        if (not key in common):
     139                print_error(["Failed to determine the value %s." % key,
     140                             "Please contact the developers of HelenOS."])
    79141
    80142def check_app(args, name, details):
     
    122184        check_app([common['OBJDUMP'], "--version"], "GNU Objdump utility", details)
    123185
    124 def create_output(cmname, common):
    125         "Create common parameters output"
    126        
    127         outcm = file(cmname, 'w')
    128        
    129         outcm.write('#########################################\n')
    130         outcm.write('## AUTO-GENERATED FILE, DO NOT EDIT!!! ##\n')
    131         outcm.write('#########################################\n\n')
     186def probe_compiler(common, sizes):
     187        "Generate, compile and parse probing source"
     188       
     189        check_common(common, "CC")
     190       
     191        outf = file(PROBE_SOURCE, 'w')
     192        outf.write(PROBE_HEAD)
     193       
     194        for typedef in sizes:
     195                outf.write("\tDECLARE_INTSIZE(%s);\n" % typedef)
     196       
     197        outf.write(PROBE_TAIL)
     198        outf.close()
     199       
     200        args = [common['CC'], "-S", "-o", PROBE_OUTPUT, PROBE_SOURCE]
     201       
     202        try:
     203                sys.stderr.write("Checking compiler properties ... ")
     204                output = subprocess.Popen(args, stdout = subprocess.PIPE, stderr = subprocess.PIPE).communicate()
     205        except:
     206                sys.stderr.write("failed\n")
     207                print_error(["Error executing \"%s\"." % " ".join(args),
     208                             "Make sure that the compiler works properly."])
     209       
     210        if (not os.path.isfile(PROBE_OUTPUT)):
     211                sys.stderr.write("failed\n")
     212                print output[1]
     213                print_error(["Error executing \"%s\"." % " ".join(args),
     214                             "The compiler did not produce the output file \"%s\"." % PROBE_OUTPUT,
     215                             "",
     216                             output[0],
     217                             output[1]])
     218       
     219        sys.stderr.write("ok\n")
     220       
     221        inf = file(PROBE_OUTPUT, 'r')
     222        lines = inf.readlines()
     223        inf.close()
     224       
     225        unsigned_sizes = {}
     226        signed_sizes = {}
     227       
     228        for j in range(len(lines)):
     229                tokens = lines[j].strip().split("\t")
     230               
     231                if (len(tokens) > 0):
     232                        if (tokens[0] == "AUTOTOOL_DECLARE"):
     233                                if (len(tokens) < 5):
     234                                        print_error(["Malformed declaration in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL])
     235                               
     236                                category = tokens[1]
     237                                subcategory = tokens[2]
     238                                name = tokens[3]
     239                                value = tokens[4]
     240                               
     241                                if (category == "intsize"):
     242                                        base = 10
     243                                       
     244                                        if ((value.startswith('$')) or (value.startswith('#'))):
     245                                                value = value[1:]
     246                                       
     247                                        if (value.startswith('0x')):
     248                                                value = value[2:]
     249                                                base = 16
     250                                       
     251                                        try:
     252                                                value_int = int(value, base)
     253                                        except:
     254                                                print_error(["Integer value expected in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL])
     255                                       
     256                                        if (subcategory == "unsigned"):
     257                                                unsigned_sizes[name] = value_int
     258                                        elif (subcategory == "signed"):
     259                                                signed_sizes[name] = value_int
     260                                        else:
     261                                                print_error(["Unexpected keyword \"%s\" in \"%s\" on line %s." % (subcategory, PROBE_OUTPUT, j), COMPILER_FAIL])
     262       
     263        return {'unsigned_sizes' : unsigned_sizes, 'signed_sizes' : signed_sizes}
     264
     265def detect_uints(unsigned_sizes, signed_sizes, bytes):
     266        "Detect correct types for fixed-size integer types"
     267       
     268        typedefs = []
     269       
     270        for b in bytes:
     271                fnd = False
     272                newtype = "uint%s_t" % (b * 8)
     273               
     274                for name, value in unsigned_sizes.items():
     275                        if (value == b):
     276                                oldtype = "unsigned %s" % name
     277                                typedefs.append({'oldtype' : oldtype, 'newtype' : newtype})
     278                                fnd = True
     279                                break
     280               
     281                if (not fnd):
     282                        print_error(['Unable to find appropriate integer type for %s' % newtype,
     283                                     COMPILER_FAIL])
     284               
     285               
     286                fnd = False
     287                newtype = "int%s_t" % (b * 8)
     288               
     289                for name, value in signed_sizes.items():
     290                        if (value == b):
     291                                oldtype = "signed %s" % name
     292                                typedefs.append({'oldtype' : oldtype, 'newtype' : newtype})
     293                                fnd = True
     294                                break
     295               
     296                if (not fnd):
     297                        print_error(['Unable to find appropriate integer type for %s' % newtype,
     298                                     COMPILER_FAIL])
     299       
     300        return typedefs
     301
     302def create_makefile(mkname, common):
     303        "Create makefile output"
     304       
     305        outmk = file(mkname, 'w')
     306       
     307        outmk.write('#########################################\n')
     308        outmk.write('## AUTO-GENERATED FILE, DO NOT EDIT!!! ##\n')
     309        outmk.write('#########################################\n\n')
    132310       
    133311        for key, value in common.items():
    134                 outcm.write('%s = %s\n' % (key, value))
    135        
    136         outcm.close()
     312                outmk.write('%s = %s\n' % (key, value))
     313       
     314        outmk.close()
     315
     316def create_header(hdname, typedefs):
     317        "Create header output"
     318       
     319        outhd = file(hdname, 'w')
     320       
     321        outhd.write('/***************************************\n')
     322        outhd.write(' * AUTO-GENERATED FILE, DO NOT EDIT!!! *\n')
     323        outhd.write(' ***************************************/\n\n')
     324       
     325        outhd.write('#ifndef %s\n' % GUARD)
     326        outhd.write('#define %s\n\n' % GUARD)
     327       
     328        for typedef in typedefs:
     329                outhd.write('typedef %s %s;\n' % (typedef['oldtype'], typedef['newtype']))
     330       
     331        outhd.write('\n#endif\n')
     332        outhd.close()
    137333
    138334def main():
     
    141337       
    142338        # Read and check configuration
    143         if os.path.exists(MAKEFILE):
    144                 read_config(MAKEFILE, config)
     339        if os.path.exists(CONFIG):
     340                read_config(CONFIG, config)
    145341        else:
    146                 print_error(["Configuration file %s not found! Make sure that the" % MAKEFILE,
     342                print_error(["Configuration file %s not found! Make sure that the" % CONFIG,
    147343                             "configuration phase of HelenOS build went OK. Try running",
    148344                             "\"make config\" again."])
     
    164360                binutils_prefix = ""
    165361       
    166         # Common utilities
    167         check_app(["ln", "--version"], "Symlink utility", "usually part of coreutils")
    168         check_app(["rm", "--version"], "File remove utility", "usually part of coreutils")
    169         check_app(["mkdir", "--version"], "Directory creation utility", "usually part of coreutils")
    170         check_app(["cp", "--version"], "Copy utility", "usually part of coreutils")
    171         check_app(["find", "--version"], "Find utility", "usually part of findutils")
    172         check_app(["diff", "--version"], "Diff utility", "usually part of diffutils")
    173         check_app(["make", "--version"], "Make utility", "preferably GNU Make")
    174         check_app(["makedepend", "-f", "-"], "Makedepend utility", "usually part of imake or xutils")
    175        
    176         # Compiler
    177         if (config['COMPILER'] == "gcc_cross"):
    178                 if (config['PLATFORM'] == "abs32le"):
    179                         check_config(config, "CROSS_TARGET")
    180                         target = config['CROSS_TARGET']
    181                        
    182                         if (config['CROSS_TARGET'] == "arm32"):
     362        owd = sandbox_enter()
     363       
     364        try:
     365                # Common utilities
     366                check_app(["ln", "--version"], "Symlink utility", "usually part of coreutils")
     367                check_app(["rm", "--version"], "File remove utility", "usually part of coreutils")
     368                check_app(["mkdir", "--version"], "Directory creation utility", "usually part of coreutils")
     369                check_app(["cp", "--version"], "Copy utility", "usually part of coreutils")
     370                check_app(["find", "--version"], "Find utility", "usually part of findutils")
     371                check_app(["diff", "--version"], "Diff utility", "usually part of diffutils")
     372                check_app(["make", "--version"], "Make utility", "preferably GNU Make")
     373                check_app(["makedepend", "-f", "-"], "Makedepend utility", "usually part of imake or xutils")
     374               
     375                # Compiler
     376                if (config['COMPILER'] == "gcc_cross"):
     377                        if (config['PLATFORM'] == "abs32le"):
     378                                check_config(config, "CROSS_TARGET")
     379                                target = config['CROSS_TARGET']
     380                               
     381                                if (config['CROSS_TARGET'] == "arm32"):
     382                                        gnu_target = "arm-linux-gnu"
     383                               
     384                                if (config['CROSS_TARGET'] == "ia32"):
     385                                        gnu_target = "i686-pc-linux-gnu"
     386                               
     387                                if (config['CROSS_TARGET'] == "mips32"):
     388                                        gnu_target = "mipsel-linux-gnu"
     389                       
     390                        if (config['PLATFORM'] == "amd64"):
     391                                target = config['PLATFORM']
     392                                gnu_target = "amd64-linux-gnu"
     393                       
     394                        if (config['PLATFORM'] == "arm32"):
     395                                target = config['PLATFORM']
    183396                                gnu_target = "arm-linux-gnu"
    184397                       
    185                         if (config['CROSS_TARGET'] == "ia32"):
     398                        if (config['PLATFORM'] == "ia32"):
     399                                target = config['PLATFORM']
    186400                                gnu_target = "i686-pc-linux-gnu"
    187401                       
    188                         if (config['CROSS_TARGET'] == "mips32"):
    189                                 gnu_target = "mipsel-linux-gnu"
    190                
    191                 if (config['PLATFORM'] == "amd64"):
    192                         target = config['PLATFORM']
    193                         gnu_target = "amd64-linux-gnu"
    194                
    195                 if (config['PLATFORM'] == "arm32"):
    196                         target = config['PLATFORM']
    197                         gnu_target = "arm-linux-gnu"
    198                
    199                 if (config['PLATFORM'] == "ia32"):
    200                         target = config['PLATFORM']
    201                         gnu_target = "i686-pc-linux-gnu"
    202                
    203                 if (config['PLATFORM'] == "ia64"):
    204                         target = config['PLATFORM']
    205                         gnu_target = "ia64-pc-linux-gnu"
    206                
    207                 if (config['PLATFORM'] == "mips32"):
    208                         check_config(config, "MACHINE")
    209                        
    210                         if ((config['MACHINE'] == "lgxemul") or (config['MACHINE'] == "msim")):
    211                                 target = config['PLATFORM']
    212                                 gnu_target = "mipsel-linux-gnu"
    213                        
    214                         if (config['MACHINE'] == "bgxemul"):
    215                                 target = "mips32eb"
    216                                 gnu_target = "mips-linux-gnu"
    217                
    218                 if (config['PLATFORM'] == "ppc32"):
    219                         target = config['PLATFORM']
    220                         gnu_target = "ppc-linux-gnu"
    221                
    222                 if (config['PLATFORM'] == "sparc64"):
    223                         target = config['PLATFORM']
    224                         gnu_target = "sparc64-linux-gnu"
    225                
    226                 path = "%s/%s/bin" % (cross_prefix, target)
    227                 prefix = "%s-" % gnu_target
    228                
    229                 check_gcc(path, prefix, common, PACKAGE_CROSS)
    230                 check_binutils(path, prefix, common, PACKAGE_CROSS)
    231                 common['CC'] = common['GCC']
    232        
    233         if (config['COMPILER'] == "gcc_native"):
    234                 check_gcc(None, "", common, PACKAGE_GCC)
    235                 check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
    236                 common['CC'] = common['GCC']
    237        
    238         if (config['COMPILER'] == "icc"):
    239                 common['CC'] = "icc"
    240                 check_app([common['CC'], "-V"], "Intel C++ Compiler", "support is experimental")
    241                 check_gcc(None, "", common, PACKAGE_GCC)
    242                 check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
    243        
    244         if (config['COMPILER'] == "suncc"):
    245                 common['CC'] = "suncc"
    246                 check_app([common['CC'], "-V"], "Sun Studio Compiler", "support is experimental")
    247                 check_gcc(None, "", common, PACKAGE_GCC)
    248                 check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
    249        
    250         if (config['COMPILER'] == "clang"):
    251                 common['CC'] = "clang"
    252                 check_app([common['CC'], "--version"], "Clang compiler", "preferably version 1.0 or newer")
    253                 check_gcc(None, "", common, PACKAGE_GCC)
    254                 check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
    255        
    256         # Platform-specific utilities
    257         if ((config['BARCH'] == "amd64") or (config['BARCH'] == "ia32") or (config['BARCH'] == "ppc32") or (config['BARCH'] == "sparc64")):
    258                 check_app(["mkisofs", "--version"], "ISO 9660 creation utility", "usually part of genisoimage")
    259        
    260         create_output(COMMON, common)
     402                        if (config['PLATFORM'] == "ia64"):
     403                                target = config['PLATFORM']
     404                                gnu_target = "ia64-pc-linux-gnu"
     405                       
     406                        if (config['PLATFORM'] == "mips32"):
     407                                check_config(config, "MACHINE")
     408                               
     409                                if ((config['MACHINE'] == "lgxemul") or (config['MACHINE'] == "msim")):
     410                                        target = config['PLATFORM']
     411                                        gnu_target = "mipsel-linux-gnu"
     412                               
     413                                if (config['MACHINE'] == "bgxemul"):
     414                                        target = "mips32eb"
     415                                        gnu_target = "mips-linux-gnu"
     416                       
     417                        if (config['PLATFORM'] == "ppc32"):
     418                                target = config['PLATFORM']
     419                                gnu_target = "ppc-linux-gnu"
     420                       
     421                        if (config['PLATFORM'] == "sparc64"):
     422                                target = config['PLATFORM']
     423                                gnu_target = "sparc64-linux-gnu"
     424                       
     425                        path = "%s/%s/bin" % (cross_prefix, target)
     426                        prefix = "%s-" % gnu_target
     427                       
     428                        check_gcc(path, prefix, common, PACKAGE_CROSS)
     429                        check_binutils(path, prefix, common, PACKAGE_CROSS)
     430                       
     431                        check_common(common, "GCC")
     432                        common['CC'] = common['GCC']
     433               
     434                if (config['COMPILER'] == "gcc_native"):
     435                        check_gcc(None, "", common, PACKAGE_GCC)
     436                        check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
     437                       
     438                        check_common(common, "GCC")
     439                        common['CC'] = common['GCC']
     440               
     441                if (config['COMPILER'] == "icc"):
     442                        common['CC'] = "icc"
     443                        check_app([common['CC'], "-V"], "Intel C++ Compiler", "support is experimental")
     444                        check_gcc(None, "", common, PACKAGE_GCC)
     445                        check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
     446               
     447                if (config['COMPILER'] == "suncc"):
     448                        common['CC'] = "suncc"
     449                        check_app([common['CC'], "-V"], "Sun Studio Compiler", "support is experimental")
     450                        check_gcc(None, "", common, PACKAGE_GCC)
     451                        check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
     452               
     453                if (config['COMPILER'] == "clang"):
     454                        common['CC'] = "clang"
     455                        check_app([common['CC'], "--version"], "Clang compiler", "preferably version 1.0 or newer")
     456                        check_gcc(None, "", common, PACKAGE_GCC)
     457                        check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
     458               
     459                # Platform-specific utilities
     460                if ((config['BARCH'] == "amd64") or (config['BARCH'] == "ia32") or (config['BARCH'] == "ppc32") or (config['BARCH'] == "sparc64")):
     461                        check_app(["mkisofs", "--version"], "ISO 9660 creation utility", "usually part of genisoimage")
     462               
     463                probe = probe_compiler(common,
     464                        [
     465                                "char",
     466                                "short int",
     467                                "int",
     468                                "long int",
     469                                "long long int",
     470                        ]
     471                )
     472               
     473                typedefs = detect_uints(probe['unsigned_sizes'], probe['signed_sizes'], [1, 2, 4, 8])
     474               
     475        finally:
     476                sandbox_leave(owd)
     477       
     478        create_makefile(MAKEFILE, common)
     479        create_header(HEADER, typedefs)
    261480       
    262481        return 0
  • tools/config.py

    r3c80f2b r4e9aaf5  
    4343MAKEFILE = 'Makefile.config'
    4444MACROS = 'config.h'
    45 DEFS = 'config.defs'
    4645PRECONF = 'defaults'
    4746
     
    225224        return True
    226225
    227 def create_output(mkname, mcname, dfname, defaults, ask_names):
     226def create_output(mkname, mcname, defaults, ask_names):
    228227        "Create output configuration"
    229228       
     
    249248        outmk = file(mkname, 'w')
    250249        outmc = file(mcname, 'w')
    251         outdf = file(dfname, 'w')
    252250       
    253251        outmk.write('#########################################\n')
     
    259257        outmc.write(' ***************************************/\n\n')
    260258       
    261         outdf.write('#########################################\n')
    262         outdf.write('## AUTO-GENERATED FILE, DO NOT EDIT!!! ##\n')
    263         outdf.write('#########################################\n\n')
    264         outdf.write('CONFIG_DEFS =')
     259        defs = 'CONFIG_DEFS ='
    265260       
    266261        for varname, vartype, name, choices, cond in ask_names:
     
    280275                        if (default == "y"):
    281276                                outmc.write('/* %s */\n#define %s\n\n' % (name, varname))
    282                                 outdf.write(' -D%s' % varname)
     277                                defs += ' -D%s' % varname
    283278                else:
    284279                        outmc.write('/* %s */\n#define %s %s\n#define %s_%s\n\n' % (name, varname, default, varname, default))
    285                         outdf.write(' -D%s=%s -D%s_%s' % (varname, default, varname, default))
     280                        defs += ' -D%s=%s -D%s_%s' % (varname, default, varname, default)
    286281       
    287282        if (revision is not None):
    288283                outmk.write('REVISION = %s\n' % revision)
    289284                outmc.write('#define REVISION %s\n' % revision)
    290                 outdf.write(' "-DREVISION=%s"' % revision)
     285                defs += ' "-DREVISION=%s"' % revision
    291286       
    292287        outmk.write('TIMESTAMP = %s\n' % timestamp)
    293288        outmc.write('#define TIMESTAMP %s\n' % timestamp)
    294         outdf.write(' "-DTIMESTAMP=%s"\n' % timestamp)
     289        defs += ' "-DTIMESTAMP=%s"\n' % timestamp
     290       
     291        outmk.write(defs)
    295292       
    296293        outmk.close()
    297294        outmc.close()
    298         outdf.close()
    299295
    300296def sorted_dir(root):
     
    355351        if ((len(sys.argv) >= 3) and (sys.argv[2] == 'default')):
    356352                if (check_choices(defaults, ask_names)):
    357                         create_output(MAKEFILE, MACROS, DEFS, defaults, ask_names)
     353                        create_output(MAKEFILE, MACROS, defaults, ask_names)
    358354                        return 0
    359355       
     
    473469                xtui.screen_done(screen)
    474470       
    475         create_output(MAKEFILE, MACROS, DEFS, defaults, ask_names)
     471        create_output(MAKEFILE, MACROS, defaults, ask_names)
    476472        return 0
    477473
  • uspace/app/Makefile.common

    r3c80f2b r4e9aaf5  
    6363    $(LIBC_PREFIX)/../../../Makefile.config \
    6464    $(LIBC_PREFIX)/../../../config.h \
    65     $(LIBC_PREFIX)/../../../config.defs \
    6665    $(LIBS) \
    6766    \
  • uspace/lib/Makefile.common

    r3c80f2b r4e9aaf5  
    6363    $(LIBC_PREFIX)/../../../Makefile.config \
    6464    $(LIBC_PREFIX)/../../../config.h \
    65     $(LIBC_PREFIX)/../../../config.defs \
    6665    $(LIBS) \
    6766    \
  • uspace/lib/libc/Makefile.toolchain

    r3c80f2b r4e9aaf5  
    5858-include $(LIBC_PREFIX)/../../../Makefile.common
    5959-include $(LIBC_PREFIX)/../../../Makefile.config
    60 -include $(LIBC_PREFIX)/../../../config.defs
    6160-include $(LIBC_PREFIX)/arch/$(UARCH)/Makefile.inc
    6261
  • uspace/srv/Makefile.common

    r3c80f2b r4e9aaf5  
    6767    $(LIBC_PREFIX)/../../../Makefile.config \
    6868    $(LIBC_PREFIX)/../../../config.h \
    69     $(LIBC_PREFIX)/../../../config.defs \
    7069    $(LIBS) \
    7170    \
     
    7877        find . -name '*.o' -follow -exec rm \{\} \;
    7978
    80 build: 
     79build:
    8180
    8281-include $(DEPEND)
  • uspace/srv/hid/console/Makefile

    r3c80f2b r4e9aaf5  
    3232.PHONY: all clean
    3333
    34 all: $(LIBC_PREFIX)/../../../Makefile.common $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     34all: $(LIBC_PREFIX)/../../../Makefile.common $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBS)
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • uspace/srv/hid/fb/Makefile

    r3c80f2b r4e9aaf5  
    3232.PHONY: all clean
    3333
    34 all: $(LIBC_PREFIX)/../../../Makefile.common $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     34all: $(LIBC_PREFIX)/../../../Makefile.common $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBS)
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • uspace/srv/hid/kbd/Makefile

    r3c80f2b r4e9aaf5  
    3232.PHONY: all clean
    3333
    34 all: $(LIBC_PREFIX)/../../../Makefile.common $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     34all: $(LIBC_PREFIX)/../../../Makefile.common $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBS)
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
Note: See TracChangeset for help on using the changeset viewer.