aboutsummaryrefslogtreecommitdiffstats
path: root/wlp/C/Makefile
blob: 6bc8fc302cafa292d6b1f75e2cd9be839387cf8e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
CC=gcc
AR=ar
FLEX=flex
YACC=bison

CCOPTS=-Wall -ansi
CCSHARED=-fPIC
AROPTS=-rs
FLEXOPTS=
YACCOPTS=-d

SRCDIR=.
BINDIR=.

OBJFILE=structs.o commands.tab.o lex.yy.o

all: archive bin

# archive file for python module
archive: structs bison flex  /usr/lib/libfl.a macro.h structs.h commands.tab.h
	$(AR) $(AROPTS)  $(BINDIR)/wlp.a $(OBJFILE) \
		/usr/lib/libfl.a

# binary (executable) file for testing
executable: bin

bin: structs bison flex  /usr/lib/libfl.a macro.h structs.h commands.tab.h
	$(CC) $(CCSHARED) $(CCOPTS) $(OBJFILE) \
		yytest.c /usr/lib/libfl.a -o ./yytest

flex:
	$(FLEX) $(FLEXOPTS) commands.l
	$(CC) $(CCSHARED) -c lex.yy.c -o lex.yy.o

bison:
	$(YACC) $(YACCOPTS) -d commands.y -b commands
	$(CC) $(CCSHARED) -c commands.tab.c -o commands.tab.o

structs:
	$(CC) $(CCSHARED) $(CCOPTS) -c structs.c -o structs.o 

clean:
	-rm $(OBJFILE) lex.yy.c commands.tab.h commands.tab.c wlp.a yytest