diff options
author | midipix <writeonce@midipix.org> | 2015-05-02 10:17:47 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-11-10 23:35:18 -0500 |
commit | 057a3a1f027ae998ba200636b40ea98589ac2f86 (patch) | |
tree | d6a876817b35851ae294f209819c1be9f810f05c | |
parent | c0fbae7a40c662ae77f59f5f919cd6b88e38a85d (diff) | |
download | perk-057a3a1f027ae998ba200636b40ea98589ac2f86.tar.bz2 perk-057a3a1f027ae998ba200636b40ea98589ac2f86.tar.xz |
added provisional Makefile.
-rw-r--r-- | Makefile | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9b34f70 --- /dev/null +++ b/Makefile @@ -0,0 +1,69 @@ +SRCTREE = . +CFE = gcc +CC = $(CROSS_COMPILE)$(CFE) +CFLAGS = -O0 -g2 -I$(SRCTREE)/include -I$(SRCTREE)/src/internal -D_XOPEN_SOURCE=900 +CFLAGS_APP = -DPERK_APP +CFLAGS_OBJ = -DPERK_PRE_ALPHA +CFLAGS_LIB = -fPIC # -DPERK_PRE_ALPHA + +OBJS = perk.o \ + pe_map_raw_image.o \ + pe_get_image_meta.o \ + pe_read_dos_header.o \ + pe_read_coff_header.o \ + pe_read_optional_header.o \ + pe_read_section_header.o \ + pe_read_export_header.o \ + pe_read_import_header.o \ + pe_output_export_symbols.o + +all: app static + +app: + $(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/main/perk.c + $(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/main/pe_map_raw_image.c + $(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/main/pe_get_image_meta.c + $(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_dos_header.c + $(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_coff_header.c + $(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_optional_header.c + $(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_section_header.c + $(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_export_header.c + $(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_import_header.c + $(CC) $(CFLAGS_APP) $(CFLAGS) -c $(SRCTREE)/src/output/pe_output_export_symbols.c + $(CC) -static -o perk $(OBJS) + +static: + $(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/main/perk.c + $(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/main/pe_map_raw_image.c + $(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/main/pe_get_image_meta.c + $(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_dos_header.c + $(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_coff_header.c + $(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_optional_header.c + $(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_section_header.c + $(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_export_header.c + $(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_import_header.c + $(CC) $(CFLAGS_OBJ) $(CFLAGS) -c $(SRCTREE)/src/output/pe_output_export_symbols.c + $(CROSS_COMPILE)ar -rc libperk.a $(OBJS) + $(CROSS_COMPILE)ranlib libperk.a + +shared: + $(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/main/perk.c + $(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/main/pe_map_raw_image.c + $(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/main/pe_get_image_meta.c + $(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_dos_header.c + $(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_coff_header.c + $(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_optional_header.c + $(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_section_header.c + $(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_export_header.c + $(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/reader/pe_read_import_header.c + $(CC) $(CFLAGS_LIB) $(CFLAGS) -c $(SRCTREE)/src/output/pe_output_export_symbols.c + $(CC) -shared -o libperk.so $(OBJS) + +clean: + rm -f *~ + rm -f *.o + rm -f *.a + rm -f *.so + rm -f *.gch + rm -f perk + rm -f perk.exe |