Skip to main content
summaryrefslogtreecommitdiffstats
blob: 4318834f0eb8a2ab8fb6ee6c5f0f6cd43dea6d49 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# makefile for libspawner.so

# set JDK_INCLUDES if they are not already set in the environment
# spit out a warning if the make script will be using the default values
ifeq ($(JDK_INCLUDES),)
$(warning JDK_INCLUDES not set in environment, using default: $(JDK_INCLUDES))
endif

ifeq ($(JDK_OS_INCLUDES),)
$(warning JDK_OS_INCLUDES not set in environment, using default: $(JDK_OS_INCLUDES))
endif


JDK_INCLUDES=/usr/local/jdk/include
JDK_OS_INCLUDES=/usr/local/jdk/include/linux

CC=gcc
CPPFLAGS = -I. -I$(JDK_INCLUDES) -I$(JDK_OS_INCLUDES)
CFLAGS +=-fpic -D_REENTRANT

LIB_NAME_SPAWNER = libspawner.so
LIB_NAME_FULL_SPAWNER = ../os/linux/x86/libspawner.so
OBJS_SPAWNER=spawner.o io.o exec_unix.o pfind.o

LIB_NAME_PTY = libpty.so
LIB_NAME_FULL_PTY = ../os/linux/x86/libpty.so
OBJS_PTY= openpty.o pty.o ptyio.o

OBJS = $(OBJS_SPAWNER) $(OBJS_PTY)

all: $(LIB_NAME_FULL_SPAWNER) $(LIB_NAME_FULL_PTY)

rebuild: clean all

$(LIB_NAME_FULL_SPAWNER) : $(OBJS_SPAWNER)
	$(CC) -g -shared -Wl,-soname,$(LIB_NAME_SPAWNER) -o $(LIB_NAME_FULL_SPAWNER) $(OBJS_SPAWNER) -lc

$(LIB_NAME_FULL_PTY): $(OBJS_PTY)
	$(CC) -g -shared -Wl,-soname,$(LIB_NAME_PTY) -o $(LIB_NAME_FULL_PTY) $(OBJS_PTY)

clean :
	$(RM) $(OBJS_SPAWNER) $(LIB_NAME_FULL_SPAWNER)
	$(RM) $(OBJS_PTY) $(LIB_NAME_FULL_PTY)

Back to the top