1 | #------------------------------------------------------------------------------ |
---|
2 | # Make rules for building one or more unit test programs. These are used to |
---|
3 | # test library modules. |
---|
4 | # |
---|
5 | # This file is intended for use in Makefile via the include directive, e.g. |
---|
6 | # |
---|
7 | # include $(BUILD_DIR)/utest_rules.mk |
---|
8 | # |
---|
9 | # It is assumed that the environment has been set by sourcing the build |
---|
10 | # resource file (buildrc). |
---|
11 | # |
---|
12 | # This file defines the following rules for library modules: |
---|
13 | # |
---|
14 | # all, exe |
---|
15 | # |
---|
16 | # Copyright (C) 2001, WSI Corporation |
---|
17 | #------------------------------------------------------------------------------ |
---|
18 | # |
---|
19 | # For portability, use the Bourne shell within Makefiles. |
---|
20 | # There have been problems using the C-shell under Linux. |
---|
21 | # |
---|
22 | SHELL=/bin/sh |
---|
23 | |
---|
24 | # |
---|
25 | # RULES for building one or more unit test programs. |
---|
26 | # |
---|
27 | all: exe |
---|
28 | exe: utest |
---|
29 | |
---|
30 | utest: $(MAIN_OBJS) |
---|
31 | @for o in $(MAIN_OBJS); do \ |
---|
32 | p=`basename $$o '.o'` ; \ |
---|
33 | echo " Building test program $$p..." ; \ |
---|
34 | echo "$(LDD) $(DEBUG) $(OPTIMIZE) -o $$p $$o $(DEP_LIBS)" ;\ |
---|
35 | $(LDD) $(DEBUG) $(OPTIMIZE) -o $$p $$o $(DEP_LIBS) ;\ |
---|
36 | done |
---|
37 | |
---|
38 | # |
---|
39 | # Include the RULES for compilation. |
---|
40 | # |
---|
41 | include $(BUILD_DIR)/compile_rules.mk |
---|
42 | |
---|
43 | # |
---|
44 | # RULE for building a library |
---|
45 | # |
---|
46 | # For exe modules, these do nothing, but we define one so that make lib |
---|
47 | # can be passed down to all source directories. |
---|
48 | # |
---|
49 | lib: |
---|
50 | @echo "make lib does nothing for unit test modules" |
---|
51 | |
---|
52 | # |
---|
53 | # RULES for cleaning up derived files. |
---|
54 | # |
---|
55 | # 'clean' removes all objects produced by this file, as well as other |
---|
56 | # extraneous artifacts of compiling and building libraries. |
---|
57 | # |
---|
58 | # A subsequent make will both recompile the source code and recreate |
---|
59 | # the executable. clean also removes files core files and other |
---|
60 | # auxilliary files created during compilation. |
---|
61 | # |
---|
62 | clean: |
---|
63 | @/bin/rm -f *.o core so_locations Makefile.bak *~ #*# |
---|
64 | @/bin/rm -fr ii_files |
---|
65 | @for o in $(MAIN_OBJS); do \ |
---|
66 | p=`basename $$o '.o'` ; \ |
---|
67 | rm -f $$p;\ |
---|
68 | done |
---|
69 | |
---|
70 | # |
---|
71 | # RULES for creating the include dependencies. |
---|
72 | # |
---|
73 | OBJS=$(MAIN_OBJS) |
---|
74 | include $(BUILD_DIR)/depend_rules.mk |
---|
75 | |
---|
76 | clean_depend: generic_clean_depend |
---|
77 | |
---|
78 | depend: generic_depend |
---|