Permalink
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (44 sloc) 1.24 KB
BIN = ckw.exe
RES = rsrc.res
RM = rm
OBJ = main.o \
option.o \
selection.o \
ime_wrap.o \
misc.o
DEFINES = -DNDEBUG -Dwcscat_s=wcscat
# --------------------------------------------------------------------
ifdef INSTDIR
all: $(INSTDIR)\$(BIN)
else
all: $(BIN)
endif
$(INSTDIR)\$(BIN): $(BIN)
command.com /c copy $(BIN) $(INSTDIR)
clean:
$(RM) -f $(OBJ) $(RES) $(BIN)
CC = gcc.exe
CP = g++.exe
WINDRES = windres.exe -J rc -O coff --include-dir $(<D)
CFLAGS = -Os -Wall \
-fno-rtti \
-fno-exceptions \
-fomit-frame-pointer \
-fmove-all-movables \
-c $(DEFINES)
LFLAGS =
LOPTS = -Wl,--entry,_wWinMain,--enable-stdcall-fixup
LIBS = -s -mwindows -nostartfiles
# --------------------------------------------------------------------
$(BIN): $(OBJ) $(RES) makefile-gcc
$(CP) $(LFLAGS) $(OBJ) $(RES) $(LIBS) $(LOPTS) -o $(BIN)
depend.txt: $(patsubst %.o,%.cpp,$(OBJ))
$(CC) -MM $^ >$@
# --------------------------------------------------------------------
%.o: %.c
$(CC) $(CFLAGS) $< -o $@
%.o: %.cpp
$(CP) $(CFLAGS) $< -o $@
%.res: %.rc
$(WINDRES) -i $< -o $@
# --------------------------------------------------------------------