source: mainline/uspace/app/bdsh/Makefile@ fcd7053

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since fcd7053 was fcd7053, checked in by Martin Decky <martin@…>, 17 years ago

cleanup configuration
code cleanup

  • Property mode set to 100644
File size: 3.6 KB
Line 
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
33
34LIBC_PREFIX = ../../lib/libc
35SOFTINT_PREFIX = ../../lib/softint
36
37include $(LIBC_PREFIX)/Makefile.toolchain
38
39CFLAGS += -I../../srv/kbd/include
40
41LIBS = $(LIBC_PREFIX)/libc.a
42DEFS += -DRELEASE=$(RELEASE)
43
44PROGRAM = bdsh
45
46# Any directory that cleaning targets should know about
47SUBDIRS = \
48 ./ \
49 cmds/ \
50 cmds/modules/ \
51 cmds/modules/help/ \
52 cmds/modules/mkdir/ \
53 cmds/modules/rm/ \
54 cmds/modules/cat/ \
55 cmds/modules/touch/ \
56 cmds/modules/ls/ \
57 cmds/modules/pwd/ \
58 cmds/modules/sleep/ \
59 cmds/modules/cp/ \
60 cmds/builtins/ \
61 cmds/builtins/exit/\
62 cmds/builtins/cd/
63
64SOURCES = \
65 cmds/modules/help/help.c \
66 cmds/modules/mkdir/mkdir.c \
67 cmds/modules/rm/rm.c \
68 cmds/modules/cat/cat.c \
69 cmds/modules/touch/touch.c \
70 cmds/modules/ls/ls.c \
71 cmds/modules/pwd/pwd.c \
72 cmds/modules/sleep/sleep.c \
73 cmds/modules/cp/cp.c \
74 cmds/builtins/exit/exit.c \
75 cmds/builtins/cd/cd.c \
76 cmds/mod_cmds.c \
77 cmds/builtin_cmds.c \
78 errors.c \
79 input.c \
80 util.c \
81 exec.c \
82 scli.c
83
84CFLAGS += -I. -Icmds/ -Icmds/builtins -Icmds/modules
85
86OBJECTS = $(SOURCES:.c=.o)
87
88# For easy cleaning, *.o is already handled
89CLEANDIRS := $(addsuffix *~,$(SUBDIRS))
90CLEANDIRS += $(addsuffix *.bak,$(SUBDIRS))
91CLEANDIRS += $(addsuffix *.tmp,$(SUBDIRS))
92CLEANDIRS += $(addsuffix *.out,$(SUBDIRS))
93CLEANDIRS += $(addsuffix *.d,$(SUBDIRS))
94CLEANDIRS += $(addsuffix *.gch,$(SUBDIRS) )
95
96%.o: %.S
97 $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
98
99%.o: %.s
100 $(AS) $(AFLAGS) $< -o $@
101
102%.o: %.c
103 $(CC) $(CFLAGS) $(INC) -c $< -o $@
104 @$(CC) -M $(CFLAGS) $(INC) $*.c > $*.d
105
106$(PROGRAM): $(OBJECTS) $(LIBS)
107 $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(PROGRAM).map
108
109# Everything else is a phony target
110.PHONY: all clean distclean depend disasm
111
112all: $(PROGRAM) disasm
113
114clean:
115 @-rm -f $(OBJECTS)
116 @-rm -f $(PROGRAM)
117 @-rm -f $(PROGRAM).map
118 @-rm -f $(PROGRAM).disasm
119 @-rm -f $(CLEANDIRS)
120
121depend:
122 @echo ''
123
124disasm:
125 $(OBJDUMP) -d $(PROGRAM) >$(PROGRAM).disasm
126
127distclean: clean
128
129# Do not delete - dependencies
130-include $(OBJECTS:.o=.d)
Note: See TracBrowser for help on using the repository browser.