Makefile 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. #
  2. # BEGIN COPYRIGHT BLOCK
  3. # This Program is free software; you can redistribute it and/or modify it under
  4. # the terms of the GNU General Public License as published by the Free Software
  5. # Foundation; version 2 of the License.
  6. #
  7. # This Program is distributed in the hope that it will be useful, but WITHOUT
  8. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  10. #
  11. # You should have received a copy of the GNU General Public License along with
  12. # this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  13. # Place, Suite 330, Boston, MA 02111-1307 USA.
  14. #
  15. # In addition, as a special exception, Red Hat, Inc. gives You the additional
  16. # right to link the code of this Program with code not covered under the GNU
  17. # General Public License ("Non-GPL Code") and to distribute linked combinations
  18. # including the two, subject to the limitations in this paragraph. Non-GPL Code
  19. # permitted under this exception must only link to the code of this Program
  20. # through those well defined interfaces identified in the file named EXCEPTION
  21. # found in the source code files (the "Approved Interfaces"). The files of
  22. # Non-GPL Code may instantiate templates or use macros or inline functions from
  23. # the Approved Interfaces without causing the resulting work to be covered by
  24. # the GNU General Public License. Only Red Hat, Inc. may make changes or
  25. # additions to the list of Approved Interfaces. You must obey the GNU General
  26. # Public License in all respects for all of the Program code and other code used
  27. # in conjunction with the Program except the Non-GPL Code covered by this
  28. # exception. If you modify this file, you may extend this exception to your
  29. # version of the file, but you are not obligated to do so. If you do not wish to
  30. # provide this exception without modification, you must delete this exception
  31. # statement from your version and license this file solely under the GPL without
  32. # exception.
  33. #
  34. #
  35. # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  36. # Copyright (C) 2005 Red Hat, Inc.
  37. # All rights reserved.
  38. # END COPYRIGHT BLOCK
  39. #
  40. #
  41. #
  42. BUILD_ROOT=../../..
  43. MODULE=LibAcl
  44. include $(BUILD_ROOT)/nsdefs.mk
  45. OBJDEST=.
  46. UTESTDEST=utest
  47. include $(BUILD_ROOT)/nsconfig.mk
  48. MODULE_CFLAGS=-I$(BUILD_ROOT)/include/libaccess -I$(BUILD_ROOT)/include -I$(BUILD_ROOT)/include/public -I. -DACL_LIB_INTERNAL
  49. include $(INCLUDE_DEPENDS)
  50. #TESTFLAGS = -DUTEST -DDEBUG_LEVEL_2
  51. TESTFLAGS = -DUTEST
  52. CC = $(CCC)
  53. CSRC = acltest.cpp onetest.cpp ustubs.cpp twotest.cpp
  54. TSRC = aclfile0 aclfile1 aclfile2 aclfile3 aclfile4 aclfile5 aclfile6 aclfile7 aclfile8 aclfile9 aclfile10 aclfile11 aclfile12 aclfile13 aclfile14 aclfile15 aclfile16 aclfile17 aclfile18 aclfile19 test.ref
  55. SRC = $(CSRC) $(TSRC)
  56. XSRC = \
  57. ../oneeval.cpp \
  58. ../lastod.cpp \
  59. ../lasip.cpp \
  60. ../aclutil.cpp \
  61. ../lasdns.cpp \
  62. ../acl.tab.cpp \
  63. ../acl.yy.cpp \
  64. ../acltools.cpp \
  65. ../aclspace.cpp \
  66. ../lasgroup.cpp \
  67. ../lasuser.cpp \
  68. ../nseframe.cpp \
  69. ../aclcache.cpp \
  70. ../register.cpp \
  71. ../symbols.cpp \
  72. ../method.cpp \
  73. ../access_plhash.cpp \
  74. ../authdb.cpp
  75. COBJ = $(CSRC:%.cpp=%.o)
  76. XOBJ = $(XSRC:../%.cpp=%.o)
  77. # This may be needed for other platforms too
  78. ifeq ($(ARCH), IRIX)
  79. XLIBS = -rpath $(LDAP_LIBPATH)
  80. endif
  81. ifeq ($(ARCH), HPUX)
  82. XLIBS = -lpthread
  83. endif
  84. ifeq ($(ARCH), SOLARIS)
  85. XLIBS = -lsocket -lnsl -ldl -lposix4
  86. endif
  87. XLIBS+= $(OBJDIR)/lib/base/plist.o \
  88. $(OBJDIR)/lib/base/pool.o \
  89. $(OBJDIR)/lib/base/util.o \
  90. $(OBJDIR)/lib/base/ereport.o \
  91. $(OBJDIR)/lib/base/system.o \
  92. $(OBJDIR)/lib/base/shexp.o \
  93. $(OBJDIR)/lib/base/file.o \
  94. $(OBJDIR)/lib/base/systhr.o \
  95. $(OBJDIR)/lib/base/nscperror.o \
  96. $(OBJDIR)/lib/libldapu.a \
  97. $(LIBNSPR)
  98. all: $(COBJ) $(TSRC) acltest
  99. ./acltest > test.out
  100. diff test.ref test.out
  101. @echo
  102. @echo "The unit test has passed if there is no diff output and the"
  103. @echo "Purify window shows no errors and 0 bytes leaked."
  104. @echo
  105. @echo "Run - gmake coverage - manually to get code coverage analysis."
  106. @echo
  107. aclparse: ustubs.o testmain.o $(XOBJ)
  108. purify $(CC) -o aclparse testmain.o $(XOBJ) ustubs.o $(XLIBS)
  109. aclparse.pure: acl.tab.o acl.yy.o testmain.o acltools.o ustubs.o
  110. purify -user-path=.. $(CC) -o aclparse.pure $(XOBJ) ustubs.o $(XLIBS)
  111. onetest: onetest.o ustubs.o $(XOBJ)
  112. $(CC) -o onetest onetest.o $(XOBJ) ustubs.o $(XLIBS)
  113. twotest: twotest.o ustubs.o $(XOBJ)
  114. $(CC) -o twotest twotest.o $(XOBJ) ustubs.o $(XLIBS)
  115. acltest: acltest.o ustubs.o $(XOBJ)
  116. # purify $(CC) -o acltest acltest.o $(XOBJ) ustubs.o $(XLIBS)
  117. $(CC) -o acltest acltest.o $(XOBJ) ustubs.o $(XLIBS)
  118. coverage: acltest.o ustubs.o $(XOBJ)
  119. purecov $(CC) -o acltestcov acltest.o $(XOBJ) ustubs.o $(XLIBS)
  120. rm -f *.pcv
  121. acltestcov
  122. lasemail: lasemail.o
  123. $(LD) -G -h lasemail.so -o lasemail.so lasemail.o
  124. #$(XOBJ): $(XSRC)
  125. # cd ..; gmake OBJDEST=$(UTESTDEST) CC=$(OCC) TESTFLAGS=$(TESTFLAGS)
  126. %.o:../%.c
  127. $(CC) -c $(CFLAGS) $(TESTFLAGS) $(MCC_INCLUDE) -I.. $< -o $(OBJDEST)/$*.o
  128. %.o:../%.cpp
  129. $(CC) -c $(CFLAGS) $(TESTFLAGS) $(MCC_INCLUDE) -I.. $< -o $(OBJDEST)/$*.o