Skip to content

Instantly share code, notes, and snippets.

@alexanderk23
Last active December 31, 2015 04:09
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 alexanderk23/7932550 to your computer and use it in GitHub Desktop.
Save alexanderk23/7932550 to your computer and use it in GitHub Desktop.
Makefile
UNAME := $(shell uname -s)
ifeq ($(UNAME),Darwin)
OSFLAGS=-D_OSX
endif
ifeq ($(UNAME),Linux)
OSFLAGS=-D_LINUX
endif
CC=gcc
CFLAGS=-std=gnu99 -lm -s -x c -O2 -Wall -Wno-unused -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE $(OSFLAGS)
SOURCES=my_strategy.c runner.c remote_process_client.c model/world.c platform/net.c
OBJS=$(SOURCES:.c=.o)
EXE=my_strategy
all: $(SOURCES) $(EXE)
$(EXE): $(OBJS)
$(CC) $(OBJS) -o $@
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f $(EXE) $(OBJS)
zip:
zip $(EXE).zip my_strategy.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment