2006-08-11 03:07:32 +00:00
|
|
|
ifeq (Windows_NT,$(OS))
|
|
|
|
WIN=1
|
|
|
|
WINCMD=1
|
|
|
|
endif
|
|
|
|
ifeq (msys,$(OSTYPE))
|
|
|
|
WIN=1
|
|
|
|
WINCMD=0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (1,$(WIN))
|
2006-05-09 21:30:31 +00:00
|
|
|
EXE = xlatcc.exe
|
|
|
|
CFLAGS = $(LOC) -Os -Wall -fomit-frame-pointer
|
|
|
|
else
|
|
|
|
EXE = xlatcc
|
|
|
|
CFLAGS = -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp $(LOC) -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
|
|
|
|
|
|
|
BISON = bison
|
|
|
|
BISONFLAGS =
|
|
|
|
|
|
|
|
OBJS = gen.o xlat-parse.tab.o
|
|
|
|
|
|
|
|
all: $(EXE)
|
|
|
|
|
|
|
|
$(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-05-09 21:30:31 +00:00
|
|
|
else
|
|
|
|
rm -f $(EXE)
|
|
|
|
rm -f *.o
|
|
|
|
endif
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
xlat-parse.tab.o: xlat-parse.tab.c xlat.h
|
|
|
|
$(CCDV) $(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
xlat-parse.tab.c: xlat-parse.y
|
|
|
|
$(CCDV) $(BISON) $(BISONFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
gen.o: gen.c xlat.h
|
|
|
|
$(CCDV) $(CC) $(CFLAGS) -c -o $@ $<
|