Skip to content

Instantly share code, notes, and snippets.

@OlivierA
Created September 27, 2011 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OlivierA/1245708 to your computer and use it in GitHub Desktop.
Save OlivierA/1245708 to your computer and use it in GitHub Desktop.
Luna's portable Makefile
CC:=gcc
CFLAGS:=-W -Wall -m32
LDFLAGS:= -lssl -lz -m32
VPATH := minizip-1.1
OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
EXEEXT = .exe
else
CFLAGS=$(CFLAGS) -Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello
LDFLAGS=$(LDFLAGS) -lcrypto
endif
all: luna$(EXEEXT)
luna$(EXEEXT): luna.o zip.o ioapi.o
gcc -o $@ $^ $(LDFLAGS)
dist: clean all
mkdir -p dist/src
rm -f *.o
find . -maxdepth 1 ! -name 'luna$(EXEEXT)' -a ! -name dist -a ! -name . -exec cp -r {} dist/src \;
cp luna$(EXEEXT) *.dll *.txt dist
clean:
rm -rf *.o luna$(EXEEXT) dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment