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-29 09:00:20 +00:00
|
|
|
EXE = lemon.exe
|
|
|
|
CFLAGS = $(LOC) -D_WIN32 -Os -Wall -Wno-implicit -fomit-frame-pointer
|
|
|
|
else
|
|
|
|
EXE = lemon
|
|
|
|
CFLAGS = -Os -Wall -Wno-implicit -fomit-frame-pointer
|
|
|
|
endif
|
|
|
|
|
2006-08-11 03:07:32 +00:00
|
|
|
CCDV = @../../ccdv
|
2006-05-29 09:00:20 +00:00
|
|
|
CC = gcc
|
|
|
|
LDFLAGS = -s
|
|
|
|
|
|
|
|
OBJS = lemon.o
|
|
|
|
|
|
|
|
all: $(EXE)
|
|
|
|
|
|
|
|
$(EXE): $(OBJS)
|
|
|
|
$(CCDV) $(CC) $(LDFLAGS) -o $(EXE) $(OBJS)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CCDV) $(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
2006-08-11 03:07:32 +00:00
|
|
|
ifeq (1,$(WINCMD))
|
2006-05-29 09:00:20 +00:00
|
|
|
-del /q /f $(EXE) 2>nul
|
|
|
|
-del /q /f *.o 2>nul
|
|
|
|
else
|
|
|
|
rm -f $(EXE)
|
|
|
|
rm -f *.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
lemon.o: lemon.c lempar.c
|
|
|
|
|