1. Cat's Eye Technologies
  2. Bhuna

Commits

Cat's Eye Technologies  committed 5281de8

De-BSD-ify Makefile, enough to build static lib and binary.

  • Participants
  • Parent commits f249bd4
  • Branches default

Comments (0)

Files changed (4)

File src/Makefile

View file
  • Ignore whitespace
-SUBDIR=lib modules driver
+CC?=gcc
 
-strip:
-	( cd lib && make strip )
-	( cd modules && make strip )
-	( cd driver && make strip )
+#CFLAGS+=-DNO_AR_STACK
+#CFLAGS+=-DPOOL_VALUES 
+CFLAGS+=-DHASH_CONSING
+CFLAGS+=-DINLINE_BUILTINS
+CFLAGS+=-Wall -ansi
 
-static:
-	( cd driver && make static )
+#CFLAGS+=-g -DDEBUG
+CFLAGS+=-DNDEBUG
+CFLAGS+=-Os -finline-functions
 
-.include <bsd.subdir.mk>
+CFLAGS+=-Ilib
+
+#CFLAGS+=-pg
+NOPROFILE=yes
+
+STATIC=
+#STATIC=-static
+
+#----------------------------------------
+
+LIB=libbhuna.a
+BIN=bhuna
+
+all: $(LIB) $(BIN)
+
+strip: $(BIN)
+	strip $(BIN)
+	ls -lah $(BIN)
+
+clean:
+	rm -f lib/*.o driver/*.o $(LIB) $(BIN)
+
+#----------------------------------------
+
+LIBOBJS=	lib/report.o \
+	lib/utf8.o lib/scan.o lib/parse.o \
+	lib/symbol.o lib/ast.o \
+	lib/type.o \
+	lib/mem.o lib/pool.o lib/gc.o \
+	lib/list.o lib/atom.o lib/buffer.o lib/closure.o lib/dict.o lib/value.o \
+	lib/activation.o \
+	lib/icode.o \
+	lib/gen.o lib/vm.o \
+	lib/process.o \
+	lib/builtin.o \
+	lib/trace.o
+
+$(LIB): $(LIBOBJS)
+	ar rc $(LIB) $(LIBOBJS)
+	ranlib $(LIB)
+
+#----------------------------------------
+
+BINOBJS=driver/main.o
+
+$(BIN): $(BINOBJS) $(LIB)
+	$(CC) $(CFLAGS) $(BINOBJS) $(STATIC) -L. -lbhuna -o $(BIN)

File src/Makefile.inc

  • Ignore whitespace
-#CFLAGS+=-DNO_AR_STACK
-#CFLAGS+=-DPOOL_VALUES 
-CFLAGS+=-DHASH_CONSING
-CFLAGS+=-DINLINE_BUILTINS
-CFLAGS+=-Wall -ansi
-
-#-I/usr/local/include
-
-.ifndef NODEBUG
-CFLAGS+=-g -DDEBUG
-.else
-CFLAGS+=-DNDEBUG
-.endif
-
-.ifdef OPTIMIZED
-CFLAGS+=-Os -finline-functions
-.endif
-
-.ifdef PROFILED
-CFLAGS+=-pg
-.else
-NOPROFILE=yes
-.endif
-
-.ifdef STATIC
-STATIC=-static
-.else
-STATIC=
-.endif

File src/driver/Makefile

  • Ignore whitespace
-CFLAGS+=-I../lib
-
-.include "../Makefile.inc"
-
-all: bhuna
-
-bhuna: main.o
-	gcc $(CFLAGS) main.o $(STATIC) -L../lib -lbhuna -o bhuna
-
-OBJS=	../lib/report.o \
-	../lib/scan.o ../lib/parse.o \
-	../lib/symbol.o ../lib/ast.o \
-	../lib/type.o \
-	../lib/mem.o ../lib/pool.o ../lib/gc.o \
-	../lib/list.o ../lib/atom.o ../lib/buffer.o ../lib/closure.o ../lib/dict.o ../lib/value.o \
-	../lib/activation.o \
-	../lib/icode.o \
-	../lib/gen.o ../lib/vm.o \
-	../lib/process.o \
-	../lib/builtin.o \
-	../lib/trace.o \
-	../lib/utf8.o
-
-static: main.o $(OBJS)
-	gcc $(CFLAGS) main.o $(OBJS) -o bhuna
-	strip bhuna
-	ls -lah bhuna
-
-main.o: main.c
-	gcc $(CFLAGS) -c main.c -o main.o
-
-clean:
-	rm -f bhuna *.o *.so
-
-strip: bhuna
-	strip bhuna
-	ls -lah bhuna

File src/lib/Makefile

View file
  • Ignore whitespace
-LIB=	bhuna
+DLIB=	libbhuna.so.0
+SLIB=   libbhuna.a
 
-SRCS=	report.c \
-	utf8.c scan.c parse.c \
-	symbol.c ast.c \
-	type.c \
-	mem.c pool.c gc.c \
-	list.c atom.c buffer.c closure.c dict.c value.c \
-	activation.c \
-	icode.c \
-	gen.c vm.c \
-	process.c \
-	builtin.c \
-	trace.c
+OBJS=	report.o \
+	utf8.o scan.o parse.o \
+	symbol.o ast.o \
+	type.o \
+	mem.o pool.o gc.o \
+	list.o atom.o buffer.o closure.o dict.o value.o \
+	activation.o \
+	icode.o \
+	gen.o vm.o \
+	process.o \
+	builtin.o \
+	trace.o
 
-NOMAN=	y
+all: $(DLIB)
 
-# DESTDIR=/usr/local/sbin
-strip: libbhuna.so.0 libbhuna.a
-	strip libbhuna.so.0
-	ls -lah libbhuna.so.0
+$(DLIB): $(OBJS)
+	$(CC) -o$(DLIB) $(OBJECTS)
 
-SHLIB_MAJOR=0
-USELIBDIR=/usr/local/lib
-USESHLIBDIR=/usr/local/lib
+clean:
+	rm -f *.o *.so.0 *.a
 
-.include <bsd.lib.mk>