Blame Makefile

83599e
SRCTREE     = .
83599e
CFE         = gcc
83599e
CC          = $(CROSS_COMPILE)$(CFE)
83599e
CFLAGS      = -O0 -g2 -I$(SRCTREE)/include -I$(SRCTREE)/src/internal -D_XOPEN_SOURCE=900
83599e
CFLAGS_APP  = -DPERK_APP
83599e
CFLAGS_OBJ  = -DPERK_PRE_ALPHA
83599e
CFLAGS_LIB  = -fPIC # -DPERK_PRE_ALPHA
83599e
LDFLAGS_APP =
83599e
LDFLAGS_LIB =
057a3a
554e91
OBJS =	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
83599e
	$(CC) -static -o perk perk.o $(OBJS) $(LDFLAGS_APP)
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
83599e
	$(CC) -shared -o libperk.so $(OBJS) $(LDFLAGS_LIB)
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