shithub: libmujs

ref: f0c795771d30ad23c29bc499ae5ac2de63a1d2a7
dir: /Makefile/

View raw version
SRCS := $(wildcard js*.c utf*.c)
HDRS := $(wildcard js*.h utf.h)
OBJS := $(SRCS:%.c=build/%.o)

CFLAGS = -Wall -g

default: build js

build:
	mkdir -p build

build/%.o : %.c $(HDRS)
	$(CC) -c $< -o $@ $(CFLAGS)

build/libjs.a: $(OBJS)
	ar cru $@ $^

opnames.h : jscompile.h
	grep 'OP_' jscompile.h | sed 's/OP_/"/;s/,.*/",/' | tr A-Z a-z > opnames.h

jsdump.c : opnames.h

js: build/main.o build/libjs.a
	$(CC) -o $@ $^ -lm

tags: $(SRCS) main.c $(HDRS)
	ctags $^

clean:
	rm -f opnames.h build/* js