Changeset 1787e527 in mainline for uspace/app


Ignore:
Timestamp:
2009-11-16T21:22:54Z (16 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5ebdf94
Parents:
fcbd1be (diff), 9c70ed6 (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 with head (unstable)

Location:
uspace/app
Files:
24 added
15 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/Makefile

    rfcbd1be r1787e527  
    1 # Copyright (c) 2005,  Martin Decky
    2 # All rights reserved.
    3 # Copyright (c) 2008, Tim Post <tinkertim@gmail.com>
     1#
     2# Copyright (c) 2005 Martin Decky
     3# Copyright (c) 2007 Jakub Jermar
    44# All rights reserved.
    55#
    66# Redistribution and use in source and binary forms, with or without
    7 # modification, are permitted provided that the following conditions are met:
     7# modification, are permitted provided that the following conditions
     8# are met:
    89#
    9 # Redistributions of source code must retain the above copyright notice, this
    10 # list of conditions and the following disclaimer.
     10# - Redistributions of source code must retain the above copyright
     11#   notice, this list of conditions and the following disclaimer.
     12# - Redistributions in binary form must reproduce the above copyright
     13#   notice, this list of conditions and the following disclaimer in the
     14#   documentation and/or other materials provided with the distribution.
     15# - The name of the author may not be used to endorse or promote products
     16#   derived from this software without specific prior written permission.
    1117#
    12 # Redistributions in binary form must reproduce the above copyright notice,
    13 # this list of conditions and the following disclaimer in the documentation
    14 # and/or other materials provided with the distribution.
     18# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     22# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     23# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     27# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1528#
    16 # Neither the name of the original program's authors nor the names of its
    17 # contributors may be used to endorse or promote products derived from this
    18 # software without specific prior written permission.
    19 #
    20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    23 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
    24 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    25 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    26 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    27 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    28 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    29 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    30 # POSSIBILITY OF SUCH DAMAGE.
    3129
    32 include ../../../version
     30include Makefile.common
    3331
    34 LIBC_PREFIX = ../../lib/libc
    35 SOFTINT_PREFIX = ../../lib/softint
    36 LIBBLOCK_PREFIX = ../../lib/libblock
     32.PHONY: all clean
    3733
    38 include $(LIBC_PREFIX)/Makefile.toolchain
    39 
    40 CFLAGS += -I../../srv/kbd/include -I$(LIBBLOCK_PREFIX)
    41 
    42 LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBC_PREFIX)/libc.a
    43 DEFS += -DRELEASE=$(RELEASE)
    44 
    45 PROGRAM = bdsh
    46 
    47 # Any directory that cleaning targets should know about
    48 SUBDIRS = \
    49         ./ \
    50         cmds/ \
    51         cmds/modules/ \
    52         cmds/modules/help/ \
    53         cmds/modules/mkdir/ \
    54         cmds/modules/rm/ \
    55         cmds/modules/bdd/ \
    56         cmds/modules/cat/ \
    57         cmds/modules/touch/ \
    58         cmds/modules/ls/ \
    59         cmds/modules/pwd/ \
    60         cmds/modules/sleep/ \
    61         cmds/modules/cp/ \
    62         cmds/modules/mv/ \
    63         cmds/modules/mount/ \
    64         cmds/modules/kcon/ \
    65         cmds/builtins/ \
    66         cmds/builtins/exit/\
    67         cmds/builtins/cd/
    68 
    69 SOURCES = \
    70         cmds/modules/help/help.c \
    71         cmds/modules/mkdir/mkdir.c \
    72         cmds/modules/rm/rm.c \
    73         cmds/modules/bdd/bdd.c \
    74         cmds/modules/cat/cat.c \
    75         cmds/modules/touch/touch.c \
    76         cmds/modules/ls/ls.c \
    77         cmds/modules/pwd/pwd.c \
    78         cmds/modules/sleep/sleep.c \
    79         cmds/modules/cp/cp.c \
    80         cmds/modules/mv/mv.c \
    81         cmds/modules/mount/mount.c \
    82         cmds/modules/kcon/kcon.c \
    83         cmds/builtins/exit/exit.c \
    84         cmds/builtins/cd/cd.c \
    85         cmds/mod_cmds.c \
    86         cmds/builtin_cmds.c \
    87         errors.c \
    88         input.c \
    89         util.c \
    90         exec.c \
    91         scli.c
    92 
    93 CFLAGS += -I. -Icmds/ -Icmds/builtins -Icmds/modules
    94 
    95 OBJECTS = $(SOURCES:.c=.o)
    96 
    97 # For easy cleaning, *.o is already handled
    98 CLEANDIRS := $(addsuffix *~,$(SUBDIRS))
    99 CLEANDIRS += $(addsuffix *.bak,$(SUBDIRS))
    100 CLEANDIRS += $(addsuffix *.tmp,$(SUBDIRS))
    101 CLEANDIRS += $(addsuffix *.out,$(SUBDIRS))
    102 CLEANDIRS += $(addsuffix *.d,$(SUBDIRS))
    103 CLEANDIRS += $(addsuffix *.gch,$(SUBDIRS) )
    104 
    105 %.o: %.S
    106         $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
    107 
    108 %.o: %.s
    109         $(AS) $(AFLAGS) $< -o $@
    110 
    111 %.o: %.c
    112         $(CC) $(CFLAGS) $(INC) -c $< -o $@
    113         @$(CC) -M $(CFLAGS) $(INC) $*.c > $*.d
    114 
    115 $(PROGRAM): $(OBJECTS) $(LIBS)
    116         $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(PROGRAM).map
    117 
    118 # Everything else is a phony target
    119 .PHONY: all clean distclean depend disasm
    120 
    121 all: $(PROGRAM) disasm
     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
    12237
    12338clean:
    124         @-rm -f $(OBJECTS)
    125         @-rm -f $(PROGRAM)
    126         @-rm -f $(PROGRAM).map
    127         @-rm -f $(PROGRAM).disasm
    128         @-rm -f $(CLEANDIRS)
    129 
    130 depend:
    131         @echo ''
    132 
    133 disasm:
    134         $(OBJDUMP) -d $(PROGRAM) >$(PROGRAM).disasm
    135 
    136 distclean: clean
    137 
    138 # Do not delete - dependencies
    139 -include $(OBJECTS:.o=.d)
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/bdsh/cmds/modules/bdd/bdd.c

    rfcbd1be r1787e527  
    4040#include <devmap.h>
    4141#include <errno.h>
     42#include <assert.h>
    4243
    43 #define BLOCK_SIZE      512
    44 #define BPR              16
     44enum {
     45        /* Number of bytes per row */
     46        BPR = 16
     47};
    4548
    4649static const char *cmdname = "bdd";
     
    6669        unsigned int i, j;
    6770        dev_handle_t handle;
    68         block_t *block;
    6971        uint8_t *blk;
    7072        size_t size, bytes, rows;
     73        size_t block_size;
    7174        int rc;
    72         bn_t boff;
     75        bn_t ba;
    7376        uint8_t b;
    7477
     
    8285
    8386        if (argc >= 3)
    84                 boff = strtol(argv[2], NULL, 0);
     87                ba = strtol(argv[2], NULL, 0);
    8588        else
    86                 boff = 0;
     89                ba = 0;
    8790
    8891        if (argc >= 4)
     
    9396        rc = devmap_device_get_handle(argv[1], &handle, 0);
    9497        if (rc != EOK) {
    95                 printf("Error: could not resolve device `%s'.\n", argv[1]);
     98                printf("%s: Error resolving device `%s'.\n", cmdname, argv[1]);
    9699                return CMD_FAILURE;
    97100        }
    98101
    99         rc = block_init(handle, BLOCK_SIZE);
     102        rc = block_init(handle, 2048);
    100103        if (rc != EOK)  {
    101                 printf("Error: could not init libblock.\n");
     104                printf("%s: Error initializing libblock.\n", cmdname);
    102105                return CMD_FAILURE;
    103106        }
    104107
    105         rc = block_cache_init(handle, BLOCK_SIZE, 2, CACHE_MODE_WB);
     108        rc = block_get_bsize(handle, &block_size);
    106109        if (rc != EOK) {
    107                 printf("Error: could not init block cache.\n");
     110                printf("%s: Error determining device block size.\n", cmdname);
     111                return CMD_FAILURE;
     112        }
     113
     114        blk = malloc(block_size);
     115        if (blk == NULL) {
     116                printf("%s: Error allocating memory.\n", cmdname);
     117                block_fini(handle);
    108118                return CMD_FAILURE;
    109119        }
    110120
    111121        while (size > 0) {
    112                 block = block_get(handle, boff, 0);
    113                 blk = (uint8_t *) block->data;
     122                rc = block_read_direct(handle, ba, 1, blk);
     123                if (rc != EOK) {
     124                        printf("%s: Error reading block %llu\n", cmdname, ba);
     125                        free(blk);
     126                        block_fini(handle);
     127                        return CMD_FAILURE;
     128                }
    114129
    115                 bytes = (size < BLOCK_SIZE) ? size : BLOCK_SIZE;
     130                bytes = (size < block_size) ? size : block_size;
    116131                rows = (bytes + BPR - 1) / BPR;
    117132
     
    139154                }
    140155
    141                 block_put(block);
    142 
    143156                if (size > rows * BPR)
    144157                        size -= rows * BPR;
     
    146159                        size = 0;
    147160
    148                 boff += rows * BPR;
     161                /* Next block */
     162                ba += 1;
    149163        }
    150164
     165        free(blk);
    151166        block_fini(handle);
    152167
  • uspace/app/bdsh/scli.c

    rfcbd1be r1787e527  
    6161        usr->line = (char *) NULL;
    6262        usr->name = "root";
    63         usr->home = "/";
    6463        usr->cwd = (char *) NULL;
    6564        usr->prompt = (char *) NULL;
    66         chdir(usr->home);
    6765        usr->lasterr = 0;
    6866        return (int) cli_set_prompt(usr);
  • uspace/app/bdsh/scli.h

    rfcbd1be r1787e527  
    77typedef struct {
    88        char *name;
    9         char *home;
    109        char *line;
    1110        char *cwd;
  • uspace/app/getvc/Makefile

    rfcbd1be r1787e527  
    11#
    2 # Copyright (c) 2009 Martin Decky
     2# Copyright (c) 2005 Martin Decky
     3# Copyright (c) 2007 Jakub Jermar
    34# All rights reserved.
    45#
     
    2728#
    2829
    29 include ../../../version
     30include Makefile.common
    3031
    31 ## Setup toolchain
    32 #
     32.PHONY: all clean
    3333
    34 LIBC_PREFIX = ../../lib/libc
    35 SOFTINT_PREFIX = ../../lib/softint
    36 
    37 include $(LIBC_PREFIX)/Makefile.toolchain
    38 
    39 LIBS = $(LIBC_PREFIX)/libc.a
    40 DEFS += -DRELEASE=$(RELEASE) "-DNAME=$(NAME)"
    41 
    42 ## Sources
    43 #
    44 
    45 OUTPUT = getvc
    46 SOURCES = \
    47         getvc.c \
    48         version.c
    49 
    50 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    51 
    52 .PHONY: all clean depend disasm
    53 
    54 all: $(OUTPUT) $(OUTPUT).disasm
    55 
    56 -include Makefile.depend
     34all: $(LIBC_PREFIX)/../../../version $(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
    5737
    5838clean:
    59         -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS)
    60 
    61 depend:
    62         $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
    63 
    64 $(OUTPUT): $(OBJECTS) $(LIBS)
    65         $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
    66 
    67 disasm: $(OUTPUT).disasm
    68 
    69 $(OUTPUT).disasm: $(OUTPUT)
    70         $(OBJDUMP) -d $< > $@
    71 
    72 %.o: %.S
    73         $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
    74 
    75 %.o: %.s
    76         $(AS) $(AFLAGS) $< -o $@
    77 
    78 %.o: %.c
    79         $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/getvc/getvc.c

    rfcbd1be r1787e527  
    3636
    3737#include <sys/types.h>
     38#include <fcntl.h>
    3839#include <unistd.h>
    3940#include <stdio.h>
     
    4647}
    4748
    48 static void closeall(void)
     49static void reopen(FILE **stream, int fd, const char *path, int flags, const char *mode)
    4950{
    50         fclose(stdin);
    51         fclose(stdout);
    52         fclose(stderr);
     51        if (fclose(*stream))
     52                return;
    5353       
    54         close(0);
    55         close(1);
    56         close(2);
     54        *stream = NULL;
     55       
     56        int oldfd = open(path, flags);
     57        if (oldfd < 0)
     58                return;
     59       
     60        if (oldfd != fd) {
     61                if (dup2(oldfd, fd) != fd)
     62                        return;
     63               
     64                if (close(oldfd))
     65                        return;
     66        }
     67       
     68        *stream = fdopen(fd, mode);
    5769}
    5870
    5971static task_id_t spawn(char *fname)
    6072{
    61         char *argv[2];
     73        char *args[2];
    6274       
    63         argv[0] = fname;
    64         argv[1] = NULL;
     75        args[0] = fname;
     76        args[1] = NULL;
    6577       
    66         task_id_t id = task_spawn(fname, argv);
     78        task_id_t id = task_spawn(fname, args);
    6779       
    6880        if (id == 0)
     
    7486int main(int argc, char *argv[])
    7587{
    76         task_exit_t texit;
    77         int retval;
    78 
    7988        if (argc < 3) {
    8089                usage();
     
    8291        }
    8392       
    84         closeall();
     93        reopen(&stdin, 0, argv[1], O_RDONLY, "r");
     94        reopen(&stdout, 1, argv[1], O_WRONLY, "w");
     95        reopen(&stderr, 2, argv[1], O_WRONLY, "w");
    8596       
    86         stdin = fopen(argv[1], "r");
    87         stdout = fopen(argv[1], "w");
    88         stderr = fopen(argv[1], "w");
    89 
    9097        /*
    91          * FIXME: fopen() should actually detect that we are opening a console
     98         * FIXME: fdopen() should actually detect that we are opening a console
    9299         * and it should set line-buffering mode automatically.
    93100         */
    94101        setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
    95102       
    96         if ((stdin == NULL)
    97             || (stdout == NULL)
    98             || (stderr == NULL))
     103        if (stdin == NULL)
    99104                return -2;
     105       
     106        if (stdout == NULL)
     107                return -3;
     108       
     109        if (stderr == NULL)
     110                return -4;
    100111       
    101112        version_print(argv[1]);
    102113        task_id_t id = spawn(argv[2]);
    103         task_wait(id, &texit, &retval);
    104114       
    105         return 0;
     115        if (id != 0) {
     116                task_exit_t texit;
     117                int retval;
     118                task_wait(id, &texit, &retval);
     119               
     120                return 0;
     121        }
     122       
     123        return -5;
    106124}
    107125
  • uspace/app/init/Makefile

    rfcbd1be r1787e527  
    11#
    22# Copyright (c) 2005 Martin Decky
     3# Copyright (c) 2007 Jakub Jermar
    34# All rights reserved.
    45#
     
    2728#
    2829
    29 ## Setup toolchain
    30 #
     30include Makefile.common
    3131
    32 LIBC_PREFIX = ../../lib/libc
    33 SOFTINT_PREFIX = ../../lib/softint
     32.PHONY: all clean
    3433
    35 include $(LIBC_PREFIX)/Makefile.toolchain
    36 
    37 CFLAGS += -I../../..
    38 LIBS = $(LIBC_PREFIX)/libc.a
    39 
    40 ## Sources
    41 #
    42 
    43 OUTPUT = init
    44 SOURCES = \
    45         init.c
    46 
    47 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    48 
    49 .PHONY: all clean depend disasm
    50 
    51 all: $(OUTPUT) $(OUTPUT).disasm
    52 
    53 -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
    5437
    5538clean:
    56         -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS)
    57 
    58 depend:
    59         $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
    60 
    61 $(OUTPUT): $(OBJECTS) $(LIBS)
    62         $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
    63 
    64 disasm: $(OUTPUT).disasm
    65 
    66 $(OUTPUT).disasm: $(OUTPUT)
    67         $(OBJDUMP) -d $< > $@
    68 
    69 %.o: %.S
    70         $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
    71 
    72 %.o: %.s
    73         $(AS) $(AFLAGS) $< -o $@
    74 
    75 %.o: %.c
    76         $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/init/init.c

    rfcbd1be r1787e527  
    4848#include <string.h>
    4949#include <devmap.h>
    50 #include <config.h>
    5150#include "init.h"
    5251
  • uspace/app/klog/Makefile

    rfcbd1be r1787e527  
    11#
    22# Copyright (c) 2005 Martin Decky
     3# Copyright (c) 2007 Jakub Jermar
    34# All rights reserved.
    45#
     
    2728#
    2829
    29 ## Setup toolchain
    30 #
     30include Makefile.common
    3131
    32 LIBC_PREFIX = ../../lib/libc
    33 SOFTINT_PREFIX = ../../lib/softint
     32.PHONY: all clean
    3433
    35 include $(LIBC_PREFIX)/Makefile.toolchain
    36 
    37 LIBS = $(LIBC_PREFIX)/libc.a
    38 
    39 ## Sources
    40 #
    41 
    42 OUTPUT = klog
    43 SOURCES = \
    44         klog.c
    45 
    46 
    47 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    48 
    49 .PHONY: all clean depend disasm
    50 
    51 all: $(OUTPUT) $(OUTPUT).disasm
    52 
    53 -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
    5437
    5538clean:
    56         -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS)
    57 
    58 depend:
    59         $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
    60 
    61 $(OUTPUT): $(OBJECTS) $(LIBS)
    62         $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
    63 
    64 disasm: $(OUTPUT).disasm
    65 
    66 $(OUTPUT).disasm: $(OUTPUT)
    67         $(OBJDUMP) -d $< > $@
    68 
    69 %.o: %.S
    70         $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
    71 
    72 %.o: %.s
    73         $(AS) $(AFLAGS) $< -o $@
    74 
    75 %.o: %.c
    76         $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/klog/klog.c

    rfcbd1be r1787e527  
    7474        }
    7575       
    76         int res = ipc_share_in_start_1_0(PHONE_NS, (void *) klog,
     76        int res = async_share_in_start_1_0(PHONE_NS, (void *) klog,
    7777            klog_size, SERVICE_MEM_KLOG);
    7878        if (res != EOK) {
  • uspace/app/tester/Makefile

    rfcbd1be r1787e527  
    11#
    22# Copyright (c) 2005 Martin Decky
     3# Copyright (c) 2007 Jakub Jermar
    34# All rights reserved.
    45#
     
    2728#
    2829
    29 ## Setup toolchain
    30 #
     30include Makefile.common
    3131
    32 LIBC_PREFIX = ../../lib/libc
    33 SOFTINT_PREFIX = ../../lib/softint
     32.PHONY: all clean
    3433
    35 include $(LIBC_PREFIX)/Makefile.toolchain
    36 
    37 CFLAGS += -I../../srv/kbd/include
    38 
    39 LIBS = $(LIBC_PREFIX)/libc.a
    40 
    41 ## Sources
    42 #
    43 
    44 OUTPUT = tester
    45 SOURCES = tester.c \
    46         thread/thread1.c \
    47         print/print1.c \
    48         print/print2.c \
    49         print/print3.c \
    50         print/print4.c \
    51         console/console1.c \
    52         stdio/stdio1.c \
    53         stdio/stdio2.c \
    54         fault/fault1.c \
    55         fault/fault2.c \
    56         vfs/vfs1.c \
    57         ipc/ping_pong.c \
    58         ipc/register.c \
    59         ipc/connect.c \
    60         loop/loop1.c \
    61         mm/malloc1.c
    62 
    63 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    64 
    65 .PHONY: all clean depend disasm
    66 
    67 all: $(OUTPUT) $(OUTPUT).disasm
    68 
    69 -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
    7037
    7138clean:
    72         -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS)
    73 
    74 depend:
    75         $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
    76 
    77 $(OUTPUT): $(OBJECTS) $(LIBS)
    78         $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
    79 
    80 disasm: $(OUTPUT).disasm
    81 
    82 $(OUTPUT).disasm: $(OUTPUT)
    83         $(OBJDUMP) -d $< > $@
    84 
    85 %.o: %.S
    86         $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
    87 
    88 %.o: %.s
    89         $(AS) $(AFLAGS) $< -o $@
    90 
    91 %.o: %.c
    92         $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/tetris/Makefile

    rfcbd1be r1787e527  
    1 LIBC_PREFIX = ../../lib/libc
    2 SOFTINT_PREFIX = ../../lib/softint
     1#
     2# Copyright (c) 2005 Martin Decky
     3# Copyright (c) 2007 Jakub Jermar
     4# All rights reserved.
     5#
     6# Redistribution and use in source and binary forms, with or without
     7# modification, are permitted provided that the following conditions
     8# are met:
     9#
     10# - Redistributions of source code must retain the above copyright
     11#   notice, this list of conditions and the following disclaimer.
     12# - Redistributions in binary form must reproduce the above copyright
     13#   notice, this list of conditions and the following disclaimer in the
     14#   documentation and/or other materials provided with the distribution.
     15# - The name of the author may not be used to endorse or promote products
     16#   derived from this software without specific prior written permission.
     17#
     18# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     22# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     23# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     27# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     28#
    329
    4 include $(LIBC_PREFIX)/Makefile.toolchain
     30include Makefile.common
    531
    6 LIBS = $(LIBC_PREFIX)/libc.a
     32.PHONY: all clean
    733
    8 OUTPUT = tetris
    9 SOURCES = shapes.c scores.c input.c tetris.c screen.c
    10 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    11 
    12 .PHONY: all clean depend disasm
    13 
    14 all: $(OUTPUT) $(OUTPUT).disasm
    15 
    16 -include Makefile.depend
    17 
    18 depend:
    19         $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
    20 
    21 $(OUTPUT): $(OBJECTS) $(LIBS)
    22         $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
     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
    2337
    2438clean:
    25         -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend *.o
    26 
    27 disasm: $(OUTPUT).disasm
    28 
    29 $(OUTPUT).disasm: $(OUTPUT)
    30         $(OBJDUMP) -d $< > $@
    31 
    32 %.o: %.S
    33         $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
    34 
    35 %.o: %.s
    36         $(AS) $(AFLAGS) $< -o $@
    37 
    38 %.o: %.c
    39         $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/tetris/screen.h

    rfcbd1be r1787e527  
    5151
    5252typedef struct {
    53         ipcarg_t ws_row;
    54         ipcarg_t ws_col;
     53        int ws_row;
     54        int ws_col;
    5555} winsize_t;
    5656
  • uspace/app/trace/Makefile

    rfcbd1be r1787e527  
    11#
    22# Copyright (c) 2005 Martin Decky
     3# Copyright (c) 2007 Jakub Jermar
    34# All rights reserved.
    45#
     
    2728#
    2829
    29 ## Setup toolchain
    30 #
     30include Makefile.common
    3131
    32 LIBC_PREFIX = ../../lib/libc
    33 SOFTINT_PREFIX = ../../lib/softint
     32.PHONY: all clean
    3433
    35 include $(LIBC_PREFIX)/Makefile.toolchain
    36 
    37 CFLAGS += -I../../srv/kbd/include
    38 
    39 LIBS = $(LIBC_PREFIX)/libc.a
    40 
    41 ## Sources
    42 #
    43 
    44 OUTPUT = trace
    45 SOURCES = trace.c \
    46         syscalls.c \
    47         ipcp.c \
    48         ipc_desc.c \
    49         proto.c \
    50         errors.c
    51 
    52 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    53 
    54 .PHONY: all clean depend disasm
    55 
    56 all: $(OUTPUT) disasm
    57 
    58 -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
    5937
    6038clean:
    61         -rm -f $(OUTPUT) $(OBJECTS) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend
    62 
    63 depend:
    64         $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
    65 
    66 $(OUTPUT): $(OBJECTS) $(LIBS)
    67         $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
    68 
    69 disasm:
    70         $(OBJDUMP) -d $(OUTPUT) >$(OUTPUT).disasm
    71 
    72 %.o: %.S
    73         $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
    74 
    75 %.o: %.s
    76         $(AS) $(AFLAGS) $< -o $@
    77 
    78 %.o: %.c
    79         $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/trace/syscalls.c

    rfcbd1be r1787e527  
    6262    [SYS_IPC_FORWARD_SLOW] = { "ipc_forward_slow",      3,      V_ERRNO },
    6363    [SYS_IPC_WAIT] = { "ipc_wait_for_call",             3,      V_HASH },
     64    [SYS_IPC_POKE] = { "ipc_poke",                      0,      V_ERRNO },
    6465    [SYS_IPC_HANGUP] = { "ipc_hangup",                  1,      V_ERRNO },
    6566    [SYS_IPC_REGISTER_IRQ] = { "ipc_register_irq",      4,      V_ERRNO },
Note: See TracChangeset for help on using the changeset viewer.