diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fec0abc --- /dev/null +++ b/Makefile @@ -0,0 +1,52 @@ +MAKE := make +CC32 := gcc -m32 +CC64 := gcc -m64 +ifneq ($(WIN32),) +CC32 := i686-w64-mingw32-gcc +SF32 := .exe +endif +ifneq ($(WIN64),) +CC64 := x86_64-w64-mingw32-gcc +SF64 := .exe +endif +RM := rm +CFLAGS := -Wall -std=gnu99 -Os +ifneq ($(NOPASTA),) +CFLAGS += -D_NOPASTA=1337 +endif +ifneq ($(DEBUG),) +CFLAGS += -g -D_DEBUG=1 +else +CFLAGS += -s +endif +ifneq ($(STATIC),) +CFLAGS += -static -ffunction-sections -fdata-sections -flto +endif +ifneq ($(SF32),) +INTERP32 := wine +endif +ifneq ($(SF64),) +INTERP64 := wine +endif + + +all: example_x86$(SF32) example_x64$(SF64) + +example_x86$(SF32): funccrypt.h funccrypt.c example.c + $(CC32) $(CFLAGS) $^ -o $@ + +example_x64$(SF64): funccrypt.h funccrypt.c example.c + $(CC64) $(CFLAGS) $^ -o $@ + +test: all + test -x example_x86$(SF32) && $(INTERP32) ./example_x86$(SF32) + test -x example_x64$(SF64) && $(INTERP64) ./example_x64$(SF64) + +full: + -$(MAKE) all + -$(MAKE) all WIN32=1 WIN64=1 + -$(MAKE) test + -$(MAKE) test WIN32=1 WIN64=1 + +clean: + $(RM) -f example_x86$(SF32) example_x64$(SF64) |