OSSP CVS Repository

ossp - ossp-pkg/cfg/Makefile
Not logged in
[Honeypot]  [Browse]  [Directory]  [Home]  [Login
[Reports]  [Search]  [Ticket]  [Timeline
  [Raw

ossp-pkg/cfg/Makefile

CC     = /usr/opkg/bin/gcc
CFLAGS = -pipe -O0 -g -ggdb3 \
		 -ansi -pedantic -Wall \
		 -Wmultichar -Wno-system-headers -Wtraditional \
		 -Wshadow -Wpointer-arith \
         -Wbad-function-cast -Wcast-align \
		 -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
         -Wredundant-decls -Wnested-externs -Winline \
		 -DDMALLOCx -I/usr/opkg/include
#CFLAGS = -Wundef -W -Wconversion -Wfloat-equal -Wunreachable-code -Wwrite-strings 
LDFLAGS = -L/usr/opkg/lib
LIBS    = # -ldmalloc
AR     = ar
RANLIB = ranlib
RM     = rm -f
BISON  = bison
FLEX   = flex-beta
GDB    = gdb

LIB    = libcfg.a
OBJ    = cfg_buf.o cfg_grid.o cfg_data.o cfg_node.o cfg_fmt.o cfg_syn.o cfg_syn_parse.o cfg_syn_scan.o cfg_util.o
TST    = cfg_test

all: $(LIB) $(TST)

.c.o:
	$(CC) $(CFLAGS) -c $<

cfg_syn.c: cfg_syn.h cfg_syn_parse.h
cfg_syn_scan.o: cfg_syn_scan.c cfg_syn_parse.h
cfg_syn_scan.c: cfg_syn_scan.l
	$(FLEX) -Pcfg_syn_ -s -8 -B -ocfg_syn_scan.c cfg_syn_scan.l
cfg_syn_parse.c cfg_syn_parse.h: cfg_syn_parse.y
	$(BISON) -d -k -pcfg_syn_ -ocfg_syn_parse.c cfg_syn_parse.y

$(LIB): $(OBJ)
	$(AR) rc $(LIB) $(OBJ)
	$(RANLIB) $(LIB)

$(TST): $(TST).o $(LIB)
	$(CC) $(LDFLAGS) -o $(TST) $(TST).o $(LIB) $(LIBS)

clean:
	$(RM) $(LIB)
	$(RM) $(OBJ)
	$(RM) $(TST).o $(TST)
	$(RM) core *.core *.aux *.log
	$(RM) cfg_syn_parse.c cfg_syn_parse.h
	$(RM) cfg_syn_scan.c

check: test
test: $(TST)
	./$(TST) sample.cfg
	./$(TST) sample2.cfg

debug: $(TST)
	$(GDB) $(TST)


CVSTrac 2.0.1