Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Redistribution and use in source and binary forms, with or without
  2. # modification, are permitted provided that the following conditions are met:
  3. #
  4. # - Redistributions of source code must retain the above copyright notice,
  5. # this list of conditions and the following disclaimer.
  6. # - Redistributions in binary form must reproduce the above copyright notice,
  7. # this list of conditions and the following disclaimer in the documentation
  8. # and/or other materials provided with the distribution.
  9. # - Neither the name of the MontaVista Software, Inc. nor the names of its
  10. # contributors may be used to endorse or promote products derived from this
  11. # software without specific prior written permission.
  12. #
  13. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  14. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  16. # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  17. # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  18. # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  19. # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  20. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  21. # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  22. # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  23. # THE POSSIBILITY OF SUCH DAMAGE.
  24. # Production mode flags
  25. CFLAGS = -O3 -Wall -fomit-frame-pointer
  26. LDFLAGS = -rdynamic
  27. # Debug mode flags
  28. #CFLAGS = -g -Wall
  29. #LDFLAGS = -g -L./ -rdynamic
  30. # Profile mode flags
  31. #CFLAGS = -O3 -pg -DDEBUG
  32. #LDFLAGS = -pg
  33. # Code Coverage with lcov flgs
  34. #CFLAGS = -ftest-coverage -fprofile-arcs
  35. #LDFLAGS = -g
  36. LDFLAGS += -ldl
  37. all:liblcr.a test test_static uic libtest_a.lcrso libtest_b.lcrso
  38. liblcr.a: lcr_ifact.o
  39. $(AR) -rc liblcr.a lcr_ifact.o
  40. libtest_a.lcrso: libtest_a.o
  41. $(CC) $(CFLAGS) -shared -Wl,-soname,libtest_b.lcrso libtest_a.o -o $@
  42. libtest_b.lcrso: libtest_b.o
  43. $(CC) $(CFLAGS) -shared -Wl,-soname,libtest_b.lcrso libtest_b.o -o $@
  44. test: test.o uis.o lcr_ifact.o
  45. $(CC) $(LDFLAGS) test.o lcr_ifact.o uis.o -lpthread -ldl -o test
  46. test_static: test.o libtest_a.o libtest_b.o uis.o lcr_ifact.o
  47. $(CC) $(LDFLAGS) test.o libtest_a.o libtest_b.o lcr_ifact.o -o test_static
  48. uic: uic.o
  49. $(CC) $(LDFLAGS) uic.o -o uic
  50. libtest_a.o: libtest_a.c
  51. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  52. libtest_b.o: libtest_b.c
  53. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  54. clean:
  55. rm -f test libtest.so* *.o uic liblcr.so* liblcr.a *.lcrso *.da *.ba *.bb *.bbg