makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # The contents of this file are subject to the Interbase Public
  2. # License Version 1.0 (the "License"); you may not use this file
  3. # except in compliance with the License. You may obtain a copy
  4. # of the License at http://www.Inprise.com/IPL.html
  5. #
  6. # Software distributed under the License is distributed on an
  7. # "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
  8. # or implied. See the License for the specific language governing
  9. # rights and limitations under the License.
  10. #
  11. # The Original Code was created by Inprise Corporation
  12. # and its predecessors. Portions created by Inprise Corporation are
  13. # Copyright (C) Inprise Corporation.
  14. #
  15. # All Rights Reserved.
  16. # Contributor(s): ______________________________________.
  17. # ---------------------------------------------------------------------
  18. # -----------------------------------------------------------------------
  19. # Firebird Installation Directory
  20. #
  21. # CHANGE this definition to point to your Firebird installation directory
  22. # -----------------------------------------------------------------------
  23. FIREBIRD = /opt/firebird
  24. DB = employee.fdb
  25. INCLUDE := -I$(FIREBIRD)/include -I../include
  26. FBCLIENT = $(FIREBIRD)/lib/libfbclient.so
  27. GPRE_M = $(FIREBIRD)/bin/gpre -c -n -m
  28. ISQL = $(FIREBIRD)/bin/isql
  29. # ---------------------------------------------------------------------
  30. # General Compiler and linker Defines for Linux
  31. # ---------------------------------------------------------------------
  32. CC= gcc
  33. LINK= gcc
  34. LIB_LINK= gcc
  35. CFLAGS= -c -std=c99 -g3 -Wall $(INCLUDE) -o
  36. LIB_CFLAGS= -fPIC -pthread $(CFLAGS)
  37. LIB_LINK_FLAGS= -shared -pthread -lfbclient -lrt -lm -ldl -lncurses
  38. RM= rm -f
  39. #
  40. # Do NOT change anything below this point.
  41. # ---------------------------------------------------------------------
  42. .PHONY: clean all
  43. .SUFFIXES: .o .c .e
  44. .e.c:
  45. $(GPRE_M) $< -d $(DB)
  46. .c.o:
  47. $(CC) $< $(CFLAGS) $@
  48. .o:
  49. $(LINK) -o $@ $< ${FBCLIENT} $(LINKFLAGS)
  50. OUTBIN = api1 api2 api3 api4 api5 api6 api7 api8 api9 api9f api10 api11 api12 api13 api14 api15 api16 api16t apifull
  51. OUTCODE = api14.c
  52. OBJS = *.o api9f.so
  53. all: api1 api2 api3 api4 api5 api6 api7 api8 api9f api9 api10 api11 api12 api13 api14 api15 api16 api16t apifull
  54. api1.o: api1.c
  55. api2.o: api2.c
  56. api3.o: api3.c
  57. api4.o: api4.c
  58. api5.o: api5.c
  59. api6.o: api6.c
  60. api7.o: api7.c
  61. api8.o: api8.c
  62. api9f.o:api9f.c
  63. $(CC) $< $(LIB_CFLAGS) $@
  64. api9f: api9f.o api9f.sql
  65. $(CC) [email protected] -o [email protected] $(LIB_LINK_FLAGS)
  66. @echo ------------------------------------------------------
  67. @echo You may need to restart the firebird service
  68. @echo in order for api9f to work correctly.
  69. @echo ------------------------------------------------------
  70. cp api9f.so $(FIREBIRD)/UDF
  71. @echo Declaring desc_filter in database $(DB)
  72. $(ISQL) -e -i api9f.sql -o api9f.txt -m -m2 $(DB)
  73. @echo ------------------------------------------------------
  74. api9.o: api9.c
  75. api9: api9.o
  76. $(LINK) [email protected] -o $@ ${FBCLIENT} $(LINKFLAGS)
  77. api10.o: api10.c
  78. api11.o: api11.c
  79. api12.o: api12.c
  80. api13.o: api13.c
  81. api14.c: api14.e
  82. $(ISQL) -e -i ../empbuild/employe2.sql -o employe2.txt -m -m2
  83. $(GPRE_M) $< -d $(DB)
  84. api14.o: api14.c
  85. api15.o: api15.c
  86. api16.o: api16.c
  87. api16t.o: api16t.c
  88. apifull.o: apifull.c
  89. clean:
  90. $(RM) $(OBJS) $(OUTBIN) $(OUTCODE)
  91. @echo Dropping desc_filter in database $(DB)
  92. -$(ISQL) -echo -input api9fdrop.sql -output api9fdrop.txt -merge -m2 $(DB)
  93. $(RM) new.fdb desc.txt a.out api9f.txt api9fdrop.txt employe2.txt employe2.fdb