diff --git a/pafish/.gitignore b/pafish/.gitignore new file mode 100644 index 0000000..8df9296 --- /dev/null +++ b/pafish/.gitignore @@ -0,0 +1,2 @@ +Objects +Output \ No newline at end of file diff --git a/pafish/Makefile b/pafish/Makefile new file mode 100644 index 0000000..8c65150 --- /dev/null +++ b/pafish/Makefile @@ -0,0 +1,36 @@ +CC = i686-pc-mingw32-gcc +WINDRES = i686-pc-mingw32-windres +OBJDIR = Objects/MingW +SRC = $(wildcard *.c) +OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(OBJDIR)/pafish_private.res +BIN = Output/MingW/pafish.exe +LINKOBJ = $(OBJDIR)/*.o $(OBJDIR)/pafish_private.res +LIBS = -s +CXXFLAGS = -fexpensive-optimizations -O1 -static-libgcc +CFLAGS = -fexpensive-optimizations -O1 +GPROF = i686-pc-mingw32-gprof +LINKFLAGS = -static-libgcc + +ifeq ($(OS),Windows_NT) + RM = del /Q + FixPath = $(subst /,\,$1) +else + RM = rm -f + FixPath = $1 +endif +LINK = i686-pc-mingw32-g++ + +.PHONY: all all-before all-after clean clean-custom +all: all-before $(BIN) all-after + +clean: clean-custom + $(RM) $(call FixPath,$(LINKOBJ)) $(call FixPath,$(BIN)) + +$(BIN): $(OBJ) + $(CC) $(LINKFLAGS) $(LINKOBJ) -o $@ $(LIBS) + +$(OBJDIR)/%.o: %.c + $(CC) $(CFLAGS) $(DIRS) -c $^ -o $@ + +$(OBJDIR)/pafish_private.res: $(OBJDIR)/pafish_private.rc + $(WINDRES) --input-format=rc -o $(OBJDIR)/pafish_private.res $(OBJDIR)/pafish_private.rc -O coff