2008-02-10 01:21:45 +00:00
|
|
|
ifeq (Windows_NT,$(OS))
|
|
|
|
WIN=1
|
|
|
|
WINCMD=1
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys)
|
|
|
|
WIN=1
|
|
|
|
WINCMD=0
|
|
|
|
endif
|
2006-08-11 03:07:32 +00:00
|
|
|
|
|
|
|
ifeq (1,$(WIN))
|
2006-05-09 21:30:31 +00:00
|
|
|
EXE = dehsupp.exe
|
|
|
|
CFLAGS = $(LOC) -Os -Wall -fomit-frame-pointer
|
2006-04-29 04:52:30 +00:00
|
|
|
else
|
2006-05-09 21:30:31 +00:00
|
|
|
EXE = dehsupp
|
2006-04-29 04:52:30 +00:00
|
|
|
CFLAGS = -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -Os -Wall -fomit-frame-pointer
|
|
|
|
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
|
|
|
CC = gcc
|
2006-05-29 09:00:20 +00:00
|
|
|
LDFLAGS = -s
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-05-25 04:32:20 +00:00
|
|
|
RE2C = ../re2c/re2c
|
|
|
|
LEMON = ../lemon/lemon
|
|
|
|
LEMONFLAGS =
|
|
|
|
RE2CFLAGS = -s
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-05-25 04:32:20 +00:00
|
|
|
OBJS = dehsupp.o parse.o scanner.o
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-05-09 21:30:31 +00:00
|
|
|
all: $(EXE)
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
$(EXE): $(OBJS)
|
2006-05-29 09:00:20 +00:00
|
|
|
$(CCDV) $(CC) $(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-04-29 04:52:30 +00:00
|
|
|
else
|
2006-05-09 21:30:31 +00:00
|
|
|
rm -f $(EXE)
|
|
|
|
rm -f *.o
|
2006-04-29 04:52:30 +00:00
|
|
|
endif
|
2006-05-09 21:30:31 +00:00
|
|
|
|
2006-05-25 04:32:20 +00:00
|
|
|
%.o: %.c
|
2006-05-09 21:30:31 +00:00
|
|
|
$(CCDV) $(CC) $(CFLAGS) -c -o $@ $<
|
2006-05-25 04:32:20 +00:00
|
|
|
|
|
|
|
parse.h parse.c: parse.y
|
|
|
|
$(CCDV) $(LEMON) $(LEMONFLAGS) $<
|
2006-05-09 21:30:31 +00:00
|
|
|
|
2006-05-25 04:32:20 +00:00
|
|
|
scanner.c: scanner.re
|
|
|
|
$(CCDV) $(RE2C) $(RE2CFLAGS) -o $@ $<
|
|
|
|
|
2006-05-09 21:30:31 +00:00
|
|
|
parse.tab.c: parse.y
|
|
|
|
$(CCDV) $(BISON) $(BISONFLAGS) -o $@ $<
|