| 1 | # To use this file, first run "makemake" and then run "make". |
|---|
| 2 | # (makemake is part of the JX distribution) |
|---|
| 3 | |
|---|
| 4 | # Useful directories |
|---|
| 5 | |
|---|
| 6 | JX_ROOT := .. |
|---|
| 7 | |
|---|
| 8 | JCOREDIR := ./code |
|---|
| 9 | PCREDIR := ${JX_ROOT}/misc/pcre |
|---|
| 10 | REGEXDIR := ${JX_ROOT}/misc/regex |
|---|
| 11 | GDDIR := ${JX_ROOT}/misc/gd |
|---|
| 12 | |
|---|
| 13 | # Directories to search for header files |
|---|
| 14 | |
|---|
| 15 | SEARCHDIRS := -I${JCOREDIR} |
|---|
| 16 | |
|---|
| 17 | # makemake variables |
|---|
| 18 | |
|---|
| 19 | include ${JX_ROOT}/include/make/jx_constants |
|---|
| 20 | include ${JX_ROOT}/include/make/jx_config |
|---|
| 21 | |
|---|
| 22 | ifdef J_HAS_GD |
|---|
| 23 | SEARCHDIRS += ${shell if test -d ${GDDIR}; then echo -I${GDDIR}; fi} |
|---|
| 24 | endif |
|---|
| 25 | |
|---|
| 26 | DEPENDFLAGS := ${J_COMPILER_DEPEND_FLAGS} \ |
|---|
| 27 | ${J_COMPILE_DEBUG} ${J_BUILD_SHARED_LIB} \ |
|---|
| 28 | ${SEARCHDIRS} |
|---|
| 29 | |
|---|
| 30 | # make variables |
|---|
| 31 | |
|---|
| 32 | LOADLIBES := |
|---|
| 33 | LDFLAGS := |
|---|
| 34 | |
|---|
| 35 | # libgd (graphics formats) |
|---|
| 36 | |
|---|
| 37 | ifdef J_HAS_GD |
|---|
| 38 | GD_FILES := ${addprefix ${GDDIR}/, \ |
|---|
| 39 | gd.o gdfx.o gd_security.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o \ |
|---|
| 40 | gd_gif_in.o gd_gif_out.o gd_io_file.o gd_io_ss.o gd_jpeg.o gd_png.o \ |
|---|
| 41 | gd_ss.o gd_topal.o gd_wbmp.o gdcache.o gdfontg.o gdfontl.o gdfontmb.o \ |
|---|
| 42 | gdfonts.o gdfontt.o gdft.o gdhelpers.o gdkanji.o gdtables.o gdxpm.o wbmp.o} |
|---|
| 43 | else |
|---|
| 44 | GD_FILES := |
|---|
| 45 | endif |
|---|
| 46 | |
|---|
| 47 | # JMemoryManager files (remember to update fake_JMM_target.a in Make.files) |
|---|
| 48 | |
|---|
| 49 | ifdef J_ARRAY_NEW_OVERRIDABLE |
|---|
| 50 | JMM_FILES := ${addprefix ${DJ_MM_DIR}/, \ |
|---|
| 51 | jNew.o JMemoryManager.o JMMTable.o JMMArrayTable.o \ |
|---|
| 52 | JMMHashTable.o JMMMonitor.o JMMErrorPrinter.o JMMRecord.o} |
|---|
| 53 | else |
|---|
| 54 | JMM_FILES := |
|---|
| 55 | endif |
|---|
| 56 | |
|---|
| 57 | ##### |
|---|
| 58 | |
|---|
| 59 | LIB_NAME_ROOT := libjcore-${JX_LIB_VERSION} |
|---|
| 60 | OTHER_DEPS := regex |
|---|
| 61 | |
|---|
| 62 | ifdef J_HAS_GD |
|---|
| 63 | OTHER_DEPS += gd |
|---|
| 64 | endif |
|---|
| 65 | |
|---|
| 66 | include ${JX_ROOT}/include/make/default_lib_target |
|---|
| 67 | |
|---|
| 68 | .PHONY : Makefiles |
|---|
| 69 | Makefiles: |
|---|
| 70 | @cd test; makemake; ${MAKE} Makefiles |
|---|
| 71 | @cd ${PCREDIR}; \ |
|---|
| 72 | if ! test -e Makefile; then ./configure; fi; |
|---|
| 73 | |
|---|
| 74 | # |
|---|
| 75 | # string data |
|---|
| 76 | # |
|---|
| 77 | |
|---|
| 78 | .PHONY : strings |
|---|
| 79 | strings: |
|---|
| 80 | ifneq (${COMPILE_STRINGS},0) |
|---|
| 81 | compile_jstrings ./strings/* \ |
|---|
| 82 | --code kJCoreDefaultStringData ${JCOREDIR}/jStringData.h |
|---|
| 83 | endif |
|---|
| 84 | |
|---|
| 85 | ${LIB_NAME_ROOT}.a :: strings |
|---|
| 86 | ${LIB_NAME_ROOT}.so:: strings |
|---|
| 87 | |
|---|
| 88 | # |
|---|
| 89 | # remove binaries |
|---|
| 90 | # |
|---|
| 91 | |
|---|
| 92 | .PHONY : tidy |
|---|
| 93 | tidy:: |
|---|
| 94 | @cd test; ${MAKE} tidy |
|---|
| 95 | |
|---|
| 96 | .PHONY : clean |
|---|
| 97 | clean:: |
|---|
| 98 | @cd test; ${MAKE} clean |
|---|
| 99 | |
|---|
| 100 | # |
|---|
| 101 | # libraries we have eaten |
|---|
| 102 | # |
|---|
| 103 | |
|---|
| 104 | .PHONY : regex |
|---|
| 105 | regex: |
|---|
| 106 | @cd ${REGEXDIR}; ${MAKE} for_jcore |
|---|
| 107 | @cd ${PCREDIR}; \ |
|---|
| 108 | if ! test -e Makefile; then ./configure; fi; \ |
|---|
| 109 | ${MAKE} |
|---|
| 110 | |
|---|
| 111 | .PHONY : gd |
|---|
| 112 | gd: |
|---|
| 113 | @cd ${GDDIR}; ${MAKE} -f makefile.sample for_jcore |
|---|
| 114 | |
|---|
| 115 | # |
|---|
| 116 | # JX source distribution (DISTR_TAR_FILE) |
|---|
| 117 | # JX binary distributions (DISTR_TAR_FILE) |
|---|
| 118 | # |
|---|
| 119 | |
|---|
| 120 | JLIB := jcore |
|---|
| 121 | include ${JX_ROOT}/include/make/jx_targets |
|---|
| 122 | |
|---|
| 123 | .PHONY : jxsource |
|---|
| 124 | jxsource:: |
|---|
| 125 | @cd test; ${MAKE} jxsource |
|---|