qse/ase/awk/makefile.mac.gcc
2007-04-28 21:31:31 +00:00

42 lines
808 B
Plaintext

OUT = aseawk
C_SRCS = awk.c err.c tree.c str.c tab.c map.c parse.c \
run.c rec.c val.c func.c misc.c extio.c rex.c
JNI_SRCS = jni.c
JAVA_SRCS = Exception.java Extio.java Awk.java StdAwk.java
C_OBJS = $(C_SRCS:.c=.o)
JNI_OBJS = $(JNI_SRCS:.c=.o)
JAVA_OBJS = $(JAVA_SRCS:.java=.class)
CC = gcc
AR = ar
LD = ld
RANLIB = ranlib
CFLAGS = -Wall -O2 -D_REENTRANT -D_THREAD_SAFE -I../..
LDFLAGS =
LIBS =
JAVAC = javac
JAVACFLAGS = -classpath ../..
all: lib jni
lib: $(C_OBJS)
$(AR) cr lib$(OUT).a $(C_OBJS)
ranlib lib$(OUT).a
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
$(CC) -bundle -o $(OUT)_jni.so $(JNI_OBJS) -lm -L. -l$(OUT)
clean:
rm -rf $(C_OBJS) $(JNI_OBJS) $(JAVA_OBJS) lib$(OUT).a lib$(OUT).so *.o
.SUFFIXES: .c .o .java .class
.c.o:
$(CC) $(CFLAGS) -c $<
.java.class:
$(JAVAC) $(JAVACFLAGS) $<