BarryServer : Git

All the code for all my projects
// BarryServer : Git / PolymorphicEngine / blob / 85e847c2fd4085ff90bc7180a721e4dee78331bd / Makefile

// Related

PolymorphicEngine

Barry Read ELF format for binary modification 85e847c (2 years, 4 months ago)
PRODUCT = poly_original

CC=gcc
CFLAGS=
LFLAGS=-T script.ld -static -s

C_SOURCES := $(shell find src -name '*.c')
OBJS = $(sort $(subst src/,build/,$(subst .c,.o,$(C_SOURCES))))

$(PRODUCT): $(OBJS)
	@echo "LINKING $(PRODUCT)..."
	@$(CC) -o $@ $^ $(LFLAGS)
	@strip --strip-all $(PRODUCT)

clean:
	@echo "REMOVING OBJECT FILES..."
	@touch $(OBJS)
	@rm $(OBJS)

build/%.o: src/%.c
	@mkdir -p build/
	@echo "COMPILING $<..."
	@$(CC) -c $< -o $@ $(CFLAGS)