Blame Makefile

057a3a
SRCTREE    = .
057a3a
CFE        = gcc
057a3a
CC         = $(CROSS_COMPILE)$(CFE)
057a3a
CFLAGS     = -O0 -g2 -I$(SRCTREE)/include -I$(SRCTREE)/src/internal -D_XOPEN_SOURCE=900
057a3a
CFLAGS_APP = -DPERK_APP
057a3a
CFLAGS_OBJ = -DPERK_PRE_ALPHA
057a3a
CFLAGS_LIB = -fPIC # -DPERK_PRE_ALPHA
057a3a
057a3a
OBJS   = perk.o \
057a3a
	pe_map_raw_image.o \
057a3a
	pe_get_image_meta.o \
057a3a
	pe_read_dos_header.o \
057a3a
	pe_read_coff_header.o \
057a3a
	pe_read_optional_header.o \
057a3a
	pe_read_section_header.o \
057a3a
	pe_read_export_header.o \
057a3a
	pe_read_import_header.o \
057a3a
	pe_output_export_symbols.o
057a3a
057a3a
all:	app static
057a3a
057a3a
app:
057a3a
	$(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/main/perk.c
057a3a
	$(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/main/pe_map_raw_image.c
057a3a
	$(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/main/pe_get_image_meta.c
057a3a
	$(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_dos_header.c
057a3a
	$(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_coff_header.c
057a3a
	$(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_optional_header.c
057a3a
	$(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_section_header.c
057a3a
	$(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_export_header.c
057a3a
	$(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_import_header.c
057a3a
	$(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/output/pe_output_export_symbols.c
057a3a
	$(CC) -static -o perk $(OBJS)
057a3a
057a3a
static:
057a3a
	$(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/main/pe_map_raw_image.c
057a3a
	$(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/main/pe_get_image_meta.c
057a3a
	$(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_dos_header.c
057a3a
	$(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_coff_header.c
057a3a
	$(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_optional_header.c
057a3a
	$(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_section_header.c
057a3a
	$(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_export_header.c
057a3a
	$(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_import_header.c
057a3a
	$(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/output/pe_output_export_symbols.c
057a3a
	$(CROSS_COMPILE)ar -rc libperk.a $(OBJS)
057a3a
	$(CROSS_COMPILE)ranlib libperk.a
057a3a
057a3a
shared:
057a3a
	$(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/main/pe_map_raw_image.c
057a3a
	$(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/main/pe_get_image_meta.c
057a3a
	$(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_dos_header.c
057a3a
	$(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_coff_header.c
057a3a
	$(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_optional_header.c
057a3a
	$(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_section_header.c
057a3a
	$(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_export_header.c
057a3a
	$(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_import_header.c
057a3a
	$(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/output/pe_output_export_symbols.c
057a3a
	$(CC) -shared -o libperk.so $(OBJS)
057a3a
057a3a
clean:
057a3a
	rm -f *~
057a3a
	rm -f *.o
057a3a
	rm -f *.a
057a3a
	rm -f *.so
057a3a
	rm -f *.gch
057a3a
	rm -f perk
057a3a
	rm -f perk.exe