source: mainline/uspace/app/bdsh/Makefile@ 39463ff

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 39463ff was 39463ff, checked in by Tim Post <echo@…>, 17 years ago

Add skeletal sleep and cp commands (not yet working)

  • Property mode set to 100644
File size: 3.8 KB
RevLine 
[216d6fc]1# Copyright (c) 2005, Martin Decky
2# All rights reserved.
3# Copyright (c) 2008, Tim Post <tinkertim@gmail.com>
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 are met:
8#
9# Redistributions of source code must retain the above copyright notice, this
10# list of conditions and the following disclaimer.
11#
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.
15#
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.
31
32include ../../../version
33include ../../Makefile.config
34
35LIBC_PREFIX = ../../lib/libc
36SOFTINT_PREFIX = ../../lib/softint
37include $(LIBC_PREFIX)/Makefile.toolchain
38
39CFLAGS += -I../../srv/kbd/include
40
41LIBS = $(LIBC_PREFIX)/libc.a
42DEFS += -DRELEASE=\"$(RELEASE)\"
43
44ifdef REVISION
45 DEFS += "-DREVISION=\"$(TIMESTAMP)\""
46endif
47
48ifdef TIMESTAMP
49 DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\""
50endif
51
52PROGRAM = bdsh
53
54# Any directory that cleaning targets should know about
55SUBDIRS = \
56 ./ \
57 cmds/ \
58 cmds/modules/ \
59 cmds/modules/help/ \
60 cmds/modules/quit/ \
61 cmds/modules/mkdir/ \
62 cmds/modules/rm/ \
63 cmds/modules/cat/ \
64 cmds/modules/touch/ \
65 cmds/modules/ls/ \
[69145dae]66 cmds/modules/pwd/ \
[39463ff]67 cmds/modules/sleep/ \
68 cmds/modules/cp/ \
[216d6fc]69 cmds/builtins/ \
[7b256b0b]70 cmds/builtins/cd/
[216d6fc]71
72SOURCES = \
73 cmds/modules/help/help.c \
74 cmds/modules/quit/quit.c \
75 cmds/modules/mkdir/mkdir.c \
76 cmds/modules/rm/rm.c \
77 cmds/modules/cat/cat.c \
78 cmds/modules/touch/touch.c \
79 cmds/modules/ls/ls.c \
[69145dae]80 cmds/modules/pwd/pwd.c \
[39463ff]81 cmds/modules/sleep/sleep.c \
82 cmds/modules/cp/cp.c \
[216d6fc]83 cmds/builtins/cd/cd.c \
84 cmds/mod_cmds.c \
85 cmds/builtin_cmds.c \
86 errors.c \
87 input.c \
88 util.c \
89 exec.c \
90 scli.c
91
[7b256b0b]92CFLAGS += -I. -Icmds/ -Icmds/builtins -Icmds/modules
[216d6fc]93
94OBJECTS = $(SOURCES:.c=.o)
95
96# For easy cleaning, *.o is already handled
97CLEANDIRS := $(addsuffix *~,$(SUBDIRS))
98CLEANDIRS += $(addsuffix *.bak,$(SUBDIRS))
99CLEANDIRS += $(addsuffix *.tmp,$(SUBDIRS))
100CLEANDIRS += $(addsuffix *.out,$(SUBDIRS))
101CLEANDIRS += $(addsuffix *.d,$(SUBDIRS))
102CLEANDIRS += $(addsuffix *.gch,$(SUBDIRS) )
103
104%.o: %.S
105 $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
106
107%.o: %.s
108 $(AS) $(AFLAGS) $< -o $@
109
110%.o: %.c
111 $(CC) $(CFLAGS) $(INC) -c $< -o $@
112 @$(CC) -M $(CFLAGS) $(INC) $*.c > $*.d
113
114$(PROGRAM): $(OBJECTS) $(LIBS)
115 $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(PROGRAM).map
116
117# Everything else is a phony target
118.PHONY: all clean distclean depend disasm
119
120all: $(PROGRAM) disasm
121
122clean:
123 @-rm -f $(OBJECTS)
124 @-rm -f $(PROGRAM)
125 @-rm -f $(PROGRAM).map
126 @-rm -f $(PROGRAM).disasm
127 @-rm -f $(CLEANDIRS)
128
129depend:
130 @echo ''
131
132disasm:
133 $(OBJDUMP) -d $(PROGRAM) >$(PROGRAM).disasm
134
135distclean: clean
136
137# Do not delete - dependencies
138-include $(OBJECTS:.o=.d)
Note: See TracBrowser for help on using the repository browser.