busconsole.mak 3.09 KB
Newer Older
1 2
PROJNAME= busconsole
APPNAME= $(PROJNAME)
3
CODEREV?= r$(shell svnversion -n $(PROJDIR))
4

5 6 7 8 9 10 11 12 13 14 15 16 17 18
SRC= \
  launcher.c \
  consolelibs.c \
  $(PRELOAD_DIR)/luaconsole.c

LUADIR= ../lua
LUASRC= \
  $(LUADIR)/openbus/console.lua

include ${LOOP_HOME}/openbus/base.mak

DEFINES= \
  OPENBUS_PROGNAME=\"$(APPNAME)\" \
  OPENBUS_CODEREV=\"$(CODEREV)\"
19

20
LIBS:= \
21
  luaopenbus \
22 23 24 25 26 27 28 29 30 31 32
  luastruct \
  luasocket \
  luatuple \
  loop \
  luacothread \
  luaidl \
  oil \
  luavararg \
  lfs \
  luuid \
  lce \
33
  luasec \
34
  luascs
35

36 37
INCLUDES+= . \
  $(SRCLUADIR) \
38
  $(LUASTRUCT_HOME)/src \
39
  $(LUASOCKET_HOME)/include \
40 41
  $(LUATUPLE_HOME)/obj/$(TEC_UNAME) \
  $(LOOP_HOME)/obj/$(TEC_UNAME) \
42
  $(LUACOTHREAD_HOME)/obj/$(TEC_UNAME) \
43 44
  $(LUAIDL_HOME)/obj/$(TEC_UNAME) \
  $(OIL_HOME)/obj/$(TEC_UNAME) \
45 46 47 48
  $(LUAVARARG_HOME)/src \
  $(LUAFILESYSTEM_HOME)/include \
  $(LUUID_HOME)/include \
  $(LCE_HOME)/include \
49
  $(LUASEC_HOME)/include \
50 51 52 53
  $(SCS_LUA_HOME)/obj/$(TEC_UNAME) \
  $(OPENBUS_LUA_HOME)/obj/$(TEC_UNAME)
LDIR+= \
  $(LUASTRUCT_HOME)/lib/$(TEC_UNAME) \
54
  $(LUASOCKET_HOME)/lib/$(TEC_UNAME) \
55
  $(LUATUPLE_HOME)/lib/$(TEC_UNAME) \
56
  $(LOOP_HOME)/lib/$(TEC_UNAME) \
57 58 59
  $(LUACOTHREAD_HOME)/lib/$(TEC_UNAME) \
  $(LUAIDL_HOME)/lib/$(TEC_UNAME) \
  $(OIL_HOME)/lib/$(TEC_UNAME) \
60 61 62 63
  $(LUAVARARG_HOME)/lib/$(TEC_UNAME) \
  $(LUAFILESYSTEM_HOME)/lib/$(TEC_UNAME) \
  $(LUUID_HOME)/lib/$(TEC_UNAME) \
  $(LCE_HOME)/lib/$(TEC_UNAME) \
64
  $(LUASEC_HOME)/lib/$(TEC_UNAME) \
65 66
  $(SCS_LUA_HOME)/lib/$(TEC_UNAME) \
  $(OPENBUS_LUA_HOME)/lib/$(TEC_UNAME)
67

68 69 70 71 72 73
ifdef USE_LUA51
  INCLUDES+= $(LUACOMPAT52_HOME)/c-api $(LUACOMPAT52_HOME)/obj/$(TEC_UNAME)
  LDIR+= $(LUACOMPAT52_HOME)/lib/$(TEC_UNAME)
  LIBS+= luacompat52 luabit32 luacompat52c
endif

74
ifeq "$(TEC_SYSNAME)" "Linux"
75
  LFLAGS = -Wl,-E -lpthread
76 77
endif
ifeq "$(TEC_SYSNAME)" "SunOS"
78 79 80 81 82 83
  USE_CC=Yes
  CFLAGS= -g -KPIC -mt -D_REENTRANT
  ifeq ($(TEC_WORDSIZE), TEC_64)
    CFLAGS+= -m64
  endif
  LFLAGS= $(CFLAGS) -xildoff
84
endif
85

86 87 88 89 90 91 92 93
ifeq ($(findstring $(TEC_SYSNAME), Win32 Win64), )
  ifdef USE_STATIC
    SLIB:= $(foreach libname, $(LIBS) uuid ssl crypto, ${OPENBUS_HOME}/lib/lib$(libname).a)
    ifeq "$(TEC_SYSNAME)" "SunOS"
      LIBS:= rt nsl socket resolv
    else
      LIBS:= 
    endif
94
  else
95 96 97
    ifneq "$(TEC_SYSNAME)" "Darwin"
      LIBS+= uuid
    endif
98
  endif
99 100
endif

101
ifneq ($(findstring $(TEC_SYSNAME), Win32 Win64), )
102
  APPTYPE= console
103 104 105 106 107 108 109 110
  LIBS+= wsock32 rpcrt4
  ifneq ($(findstring dll, $(TEC_UNAME)), ) # USE_DLL
    ifdef DBG
      LIBS+= libeay32MDd ssleay32MDd
    else
      LIBS+= libeay32MD ssleay32MD
    endif
    LDIR+= $(OPENSSL_HOME)/lib/VC
111
  else
112 113 114 115 116 117
    ifdef DBG
      LIBS+= libeay32MTd ssleay32MTd
    else
      LIBS+= libeay32MT ssleay32MT
    endif
    LDIR+= $(OPENSSL_HOME)/lib/VC/static
118
  endif
119 120 121
else
  LIBS+= dl
endif
122 123 124 125 126 127 128 129 130

$(PRELOAD_DIR)/luaconsole.c $(PRELOAD_DIR)/luaconsole.h: $(LUAPRELOADER) $(LUASRC)
	$(LOOPBIN) $(LUAPRELOADER) -l "$(LUADIR)/?.lua" \
	                           -d $(PRELOAD_DIR) \
	                           -h luaconsole.h \
	                           -o luaconsole.c \
	                           $(LUASRC)

luaconsole.c: $(PRELOAD_DIR)/luaconsole.h
131
consolelibs.c: $(PRELOAD_DIR)/luaconsole.h