
And this is the big "Fix the Parser" patch. It turns the sam_parse function in src/parse.c into something that actually works. Generating the argument list from an incoming SAM thingy is a bit memory churn-y; perhaps when I have time I'll replace all those strdups with structures that simply track the (start,end) indices. Oh and also I moved i2p-ping to the new system. Which required 0 change in code. All I did was fix the Makefile, and add shared library libtool support. Anyway, so enjoy folks. It's rare I'm this productive - polecat
54 lines
979 B
Makefile
54 lines
979 B
Makefile
FLAGS+=-g
|
|
|
|
CFLAGS = $(FLAGS) -pipe -std=c99 -Wall
|
|
CFLAGS += -I../../inc
|
|
LDFLAGS = $(FLAGS) -L../../lib -lsam
|
|
|
|
OBJS:=i2p-ping.lo
|
|
DEPS:=$(patsubst obj/%.lo, .deps/%.d, $(OBJS))
|
|
DESTDIR:=$(if $(DESTDIR),$(DESTDIR)/lib,/usr/lib)
|
|
|
|
MAKEFLAGS=-s -r
|
|
PERL=$(shell which perl 2>/dev/null)
|
|
ifneq ($(PERL),)
|
|
STATUS=$(PERL) ../../status
|
|
else
|
|
STATUS=echo
|
|
endif
|
|
|
|
LIBTOOL_LOG=libtool.log
|
|
|
|
all:: cleanlog i2p-ping
|
|
|
|
cleanlog:
|
|
>$(LIBTOOL_LOG)
|
|
|
|
i2p-ping: $(OBJS)
|
|
$(STATUS) link
|
|
libtool --mode=link gcc $(LDFLAGS) -o $@ $^ >>$(LIBTOOL_LOG)
|
|
|
|
%.lo: %.c
|
|
$(STATUS) compile $*
|
|
libtool --mode=compile gcc $(CFLAGS) -Iinc/ -c -o $@ $< >>$(LIBTOOL_LOG)
|
|
.deps/%.d: src/%.c
|
|
$(STATUS) deps $*
|
|
gcc -Iinc/ -MM -MT obj/$*.o $^ -o $@
|
|
|
|
clean:
|
|
$(STATUS) clean
|
|
rm -Rf .deps obj libtool.log
|
|
libtool --mode=clean rm -f i2p-ping i2p-ping.lo >>$(LIBTOOL_LOG)
|
|
|
|
$(OBJS):|obj
|
|
obj:
|
|
$(STATUS) MKDIR $@
|
|
mkdir -p $@
|
|
|
|
-include $(DEPS)
|
|
$(DEPS):|.deps
|
|
.deps:
|
|
$(STATUS) MKDIR $@
|
|
mkdir -p $@
|
|
|
|
|
|
.PHONY: all cleanlog clean |