2008-01-26 04:33:34 +00:00
|
|
|
ifeq (Windows_NT,$(OS))
|
|
|
|
WIN=1
|
|
|
|
WINCMD=1
|
|
|
|
endif
|
2008-02-10 01:21:45 +00:00
|
|
|
ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys)
|
2008-01-26 04:33:34 +00:00
|
|
|
WIN=1
|
|
|
|
WINCMD=0
|
|
|
|
endif
|
2006-08-11 03:07:32 +00:00
|
|
|
|
|
|
|
ifeq (1,$(WIN))
|
2006-05-29 09:00:20 +00:00
|
|
|
EXE = re2c.exe
|
|
|
|
CXXFLAGS = $(LOC) -D_WIN32 -DNDEBUG -Os -Wall -Wno-unused
|
|
|
|
else
|
|
|
|
EXE = re2c
|
|
|
|
CXXFLAGS = -DHAVE_CONFIG_H -DNDEBUG -Os -Wall -Wno-unused
|
|
|
|
endif
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-08-11 03:07:32 +00:00
|
|
|
CCDV = @../../ccdv
|
2006-02-24 04:48:15 +00:00
|
|
|
CXX = g++
|
2006-05-29 09:00:20 +00:00
|
|
|
LDFLAGS= -s
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
OBJS = actions.o code.o dfa.o main.o mbo_getopt.o parser.o scanner.o substr.o translate.o
|
|
|
|
|
|
|
|
all: $(EXE)
|
|
|
|
|
|
|
|
.cc.o:
|
|
|
|
$(CCDV) $(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
$(EXE): $(OBJS)
|
2006-05-29 09:00:20 +00:00
|
|
|
$(CCDV) $(CXX) $(LDFLAGS) -o $(EXE) $(OBJS)
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
2006-08-11 03:07:32 +00:00
|
|
|
ifeq (1,$(WINCMD))
|
2006-02-24 04:48:15 +00:00
|
|
|
-del /q /f $(EXE) 2>nul
|
|
|
|
-del /q /f *.o 2>nul
|
2006-05-29 09:00:20 +00:00
|
|
|
else
|
|
|
|
rm -f $(EXE)
|
|
|
|
rm -f *.o
|
|
|
|
endif
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
actions.o: actions.cc
|
|
|
|
code.o: code.cc
|
|
|
|
dfa.o: dfa.cc
|
|
|
|
main.o: main.cc
|
|
|
|
mbo_getopt.o: mbo_getopt.cc
|
|
|
|
parser.o: parser.cc
|
|
|
|
scanner.o: scanner.cc
|
|
|
|
substr.o: substr.cc
|
|
|
|
translate.o: translate.cc
|