btcs

bitcoin script parser/evaluator/compiler/decompiler
git clone git://jb55.com/btcs
Log | Files | Refs | README | LICENSE

Makefile (1233B)


      1 CFLAGS=-g -DHAVE_LITTLE_ENDIAN -O2 -Ideps -std=c99 -Wall -Wextra -Werror -Wno-unused-variable -Wno-unused-function 
      2 
      3 DEPS=script.c \
      4      oplookup.c \
      5      op.c \
      6      val.c \
      7      alloc.c \
      8      script_num.c \
      9      sha256.c \
     10      ripemd160.c \
     11      compiler.c \
     12      util.c \
     13      stack.c
     14 
     15 CLIDEPS=parser.tab.c \
     16 	lex.yy.c \
     17 	main.c
     18 
     19 # DEPS=oplookup.h script.h misc.h Makefile op.h stack.h
     20 OBJS=$(DEPS:.c=.o)
     21 CLIOBJS=$(CLIDEPS:.c=.o)
     22 
     23 GEN=parser.tab.c \
     24     parser.tab.h \
     25     lex.yy.c \
     26     oplookup.c \
     27     oplookup.h \
     28     $(OBJS) \
     29     $(CLIOBJS) \
     30 
     31 
     32 PREFIX ?= /usr/local
     33 BIN=btcs
     34 
     35 all: $(BIN)
     36 
     37 include $(OBJS:.o=.d)
     38 include $(CLIOBJS:.o=.d)
     39 
     40 op.c: oplookup.h oplookup.c
     41 
     42 %.d: %.c
     43 	@rm -f $@; \
     44 	$(CC) -MM $(CFLAGS) $< > $@
     45 
     46 oplookup.c oplookup.h: opcodes mph-opcodes
     47 	@./mph-opcodes opcodes
     48 
     49 parser.tab.c parser.tab.h:	parser.y
     50 	bison -d parser.y
     51 
     52 lex.yy.c: lexer.l parser.tab.h
     53 	flex lexer.l
     54 
     55 install: $(BIN)
     56 	mkdir -p $(PREFIX)/bin
     57 	mkdir -p $(PREFIX)/share/btcs
     58 	cp $(BIN) $(PREFIX)/bin
     59 	cp btcs.1 $(PREFIX)/share/btcs
     60 
     61 $(BIN): $(OBJS) $(CLIOBJS)
     62 	$(CC) $(CFLAGS) -o $@ $(OBJS) $(CLIOBJS)
     63 
     64 
     65 check: $(BIN) fake
     66 	@sh -c "cd test && ./run"
     67 
     68 clean: fake
     69 	rm -f $(GEN)
     70 	rm -f *.d
     71 
     72 TAGS: fake
     73 	etags -o - *.c > $@
     74 
     75 
     76 .PHONY: fake